Skip to content

Commit 5640918

Browse files
author
Llorenç Muntaner
authored
Follow redirects to get canister id to check alternative origins (#3282)
1 parent be75f04 commit 5640918

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/frontend/src/lib/utils/canisterIdResolution.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,11 @@ const lookupCanister = async ({
7171
}): Promise<{ ok: Principal } | "not_found"> => {
7272
const HEADER_NAME = "x-ic-canister-id";
7373
try {
74-
const response = await fetch(
75-
origin,
76-
// fail on redirects
77-
{
78-
redirect: "error",
79-
method: "HEAD",
80-
// do not send cookies or other credentials
81-
credentials: "omit",
82-
},
83-
);
74+
const response = await fetch(origin, {
75+
method: "HEAD",
76+
// do not send cookies or other credentials
77+
credentials: "omit",
78+
});
8479

8580
const headerValue = response.headers.get(HEADER_NAME);
8681
if (isNullish(headerValue)) {

0 commit comments

Comments
 (0)