mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +00:00
fix: use .has instead of .get
This commit is contained in:
parent
17549a4f24
commit
ffe3e24bbd
2 changed files with 2 additions and 2 deletions
|
|
@ -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 +
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue