*Move https redirect to request handler directly

This commit is contained in:
Derrick Hammer 2022-09-08 07:30:35 -04:00
parent 29125ab6a3
commit 8a0de28d32
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 9 additions and 4 deletions

View File

@ -136,10 +136,6 @@ export default class IpfsProvider extends BaseProvider {
let fetchMethod: typeof fetchIpfs | typeof fetchIpns;
let err;
let contentType: string;
if (urlObj.protocol == "https") {
urlObj.protocol = "http";
return { redirectUrl: urlObj.toString() };
}
let contentSize = 0;
let cachedPage: { contentType: string; data: Blob } | null = null;

View File

@ -108,6 +108,15 @@ export default class WebEngine {
return { redirectUrl: navRedirect as string };
}
const provider = this.getRequestProvider(details.requestId);
if (provider) {
let urlObj = new URL(details.url);
if (urlObj.protocol == "https") {
urlObj.protocol = "http";
return { redirectUrl: urlObj.toString() };
}
}
return this.processHandler(details, "handleRequest");
}