fix: fixed URL sanitization

This commit is contained in:
burned65 2025-09-16 17:47:33 +02:00
parent e731d1af44
commit 56af1fa748

View file

@ -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 });