diff --git a/src/core/parentClient.ts b/src/core/parentClient.ts index 3a6ab65..b20882d 100644 --- a/src/core/parentClient.ts +++ b/src/core/parentClient.ts @@ -41,7 +41,7 @@ export class ParentClient extends BaseClient { headers: headers, credentials: undefined, }); - if (response.status != 302 || !response.headers.get("set-cookie")) { + if (response.status != 302 || !response.headers.has("set-cookie")) { throw new Error( "Unauthenticated: ClassCharts returned an error: " + response.status + diff --git a/src/core/studentClient.ts b/src/core/studentClient.ts index 000c857..464a22d 100644 --- a/src/core/studentClient.ts +++ b/src/core/studentClient.ts @@ -41,7 +41,7 @@ export class StudentClient extends BaseClient { body: formData, redirect: "manual", }); - if (request.status != 302 || !request.headers.get("set-cookie")) { + if (request.status != 302 || !request.headers.has("set-cookie")) { await request.body?.cancel(); // Make deno tests happy by closing the body, unsure whether this is needed for the actual library throw new Error( "Unauthenticated: ClassCharts didn't return authentication cookies",