-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from ipfs/fix/redirect-loop
fix: remove JS redirect that causes loop
- Loading branch information
Showing
2 changed files
with
2 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
<!doctype html><html lang="en-US"> | ||
<head> | ||
<script> | ||
// if someone tries to open a gateway path on .tech, redirect to .io | ||
const { hostname, pathname, href: url } = window.location | ||
if (hostname === 'ipfs.tech' && (pathname.startsWith('/ipns/') || pathname.startsWith('/ipfs/'))) { | ||
window.location.replace(url.replace('//ipfs.tech/', '//ipfs.io/')) | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<h1>Not a gateway :-)</h1> | ||
<p>Try one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p> | ||
<p>Try loading this path from one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
<!doctype html><html lang="en-US"> | ||
<head> | ||
<script> | ||
// if someone tries to open a gateway path on .tech, redirect to .io | ||
const { hostname, pathname, href: url } = window.location | ||
if (hostname === 'ipfs.tech' && (pathname.startsWith('/ipns/') || pathname.startsWith('/ipfs/'))) { | ||
window.location.replace(url.replace('//ipfs.tech/', '//ipfs.io/')) | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<h1>Not a gateway :-)</h1> | ||
<p>Try one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p> | ||
<p>Try loading this path from one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p> | ||
</body> |