diff --git a/src.ts/utils/geturl-browser.ts b/src.ts/utils/geturl-browser.ts index 6cb4d3bc5d..9d528f6788 100644 --- a/src.ts/utils/geturl-browser.ts +++ b/src.ts/utils/geturl-browser.ts @@ -35,7 +35,7 @@ export async function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Pr operation: "request" }); - assert(!req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { + assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { operation: "request" }); diff --git a/src.ts/utils/geturl.ts b/src.ts/utils/geturl.ts index 4858333fc1..de024c6da2 100644 --- a/src.ts/utils/geturl.ts +++ b/src.ts/utils/geturl.ts @@ -19,7 +19,7 @@ export async function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Pro operation: "request" }); - assert(!req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { + assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { operation: "request" });