mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(electron): use includes() instead of in operator for hostname check
The `in` operator checks for array indices, not values, so the condition was always false. This prevented User-Agent header removal for GitHub, Office365, and Outlook requests.
This commit is contained in:
parent
5ca64347ef
commit
52fd0dfc75
1 changed files with 3 additions and 1 deletions
|
|
@ -158,7 +158,9 @@ export const createWindow = async ({
|
|||
// NOTE this is needed for GitHub api requests to work :(
|
||||
// office365 needs a User-Agent as well (#4677)
|
||||
if (
|
||||
new URL(details.url).hostname in ['github.com', 'office365.com', 'outlook.live.com']
|
||||
['github.com', 'office365.com', 'outlook.live.com'].includes(
|
||||
new URL(details.url).hostname,
|
||||
)
|
||||
) {
|
||||
removeKeyInAnyCase(requestHeaders, 'User-Agent');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue