From 56af1fa748b57e0540faa9307ca497e669c2d8ca Mon Sep 17 00:00:00 2001 From: burned65 Date: Tue, 16 Sep 2025 17:47:33 +0200 Subject: [PATCH] fix: fixed URL sanitization --- electron/main-window.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/electron/main-window.ts b/electron/main-window.ts index f88b69385..26c47a1d5 100644 --- a/electron/main-window.ts +++ b/electron/main-window.ts @@ -119,11 +119,7 @@ export const createWindow = ({ // NOTE this is needed for GitHub api requests to work :( // office365 needs a User-Agent as well (#4677) - if ( - !details.url.includes('github.com') && - !details.url.includes('office365.com') && - !details.url.includes('outlook.live.com') - ) { + if (new URL(details.url).hostname in ['github.com', 'office365.com', 'outlook.live.com']) { removeKeyInAnyCase(requestHeaders, 'User-Agent'); } callback({ requestHeaders });