Fixed FetchRequest when using credentials (#3897).

This commit is contained in:
Richard Moore 2023-03-23 23:31:31 -04:00
parent c05a84aa65
commit 88e8124c37
2 changed files with 2 additions and 2 deletions

View File

@ -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"
});

View File

@ -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"
});