Skip to content

Commit

Permalink
Fix headerToToken value check from null to undefined
Browse files Browse the repository at this point in the history
`headerToToken` returns `Promise<string | undefined>`. However, the existing
check assessed `headerToToken().then(value => value === null ? something
: somethingElse)`.
This should never be true.
Instead, this check is replaced with `!value`.
  • Loading branch information
thibmeu committed Jan 11, 2024
1 parent 461780f commit e1af955
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export const handleHeadersReceived =
}
const redirectPromise = w3HeaderValue
.then(async (value): Promise<void | chrome.webRequest.BlockingResponse> => {
if (value === null) {
if (!value) {
delete TOKENS[details.url];
return;
}
Expand Down

0 comments on commit e1af955

Please sign in to comment.