We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c0fb34 commit 3ad7592Copy full SHA for 3ad7592
background/dat-dns.js
@@ -7,8 +7,8 @@ export function resolveName(host) {
7
if (wellKnownCache.has(host)) {
8
resolve(Promise.resolve(wellKnownCache.get(host)));
9
}
10
- fetch(`https://${host}/.well-known/dat`, { redirect: 'manual' }).then((resp) => {
11
- if (resp.ok) {
+ fetch(`https://${host}/.well-known/dat`, { redirect: 'follow' }).then((resp) => {
+ if (resp.ok && new URL(resp.url).protocol == 'https:') {
12
return resp.text().then(text => {
13
try {
14
return /^dat:\/\/([0-9a-f]{64})/i.exec(text.split('/n')[0])[1];
@@ -27,4 +27,4 @@ export function resolveName(host) {
27
resolve(address);
28
});
29
30
-}
+}
0 commit comments