From 3c9de637d73e184670dc2b8b2556a526ae41ad88 Mon Sep 17 00:00:00 2001 From: KillariDev Date: Mon, 29 Jan 2024 17:01:27 +0200 Subject: [PATCH] redirect 127.0.0.1 to localhost --- src/components/IpfsSubpathRedirect.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/IpfsSubpathRedirect.tsx b/src/components/IpfsSubpathRedirect.tsx index 0962233c132..5b9a7f209d4 100644 --- a/src/components/IpfsSubpathRedirect.tsx +++ b/src/components/IpfsSubpathRedirect.tsx @@ -26,5 +26,6 @@ function extractIpfsHashFromBasePath() { function generateIpfsSubdomainUrl(cidHash: string) { const cidV1String = CID.parse(cidHash).toV1().toString() - return `${location.protocol}//${cidV1String}.ipfs.${location.host}` + const host = window.location.hostname === '127.0.0.1' ? `localhost:${location.port}` : location.host + return `${location.protocol}//${cidV1String}.ipfs.${host}` }