This commit is contained in:
Ray Lothian 2022-11-13 06:36:17 -05:00
parent 4d968b7bc5
commit 7bfa6be62c

View file

@ -553,14 +553,19 @@ const onBeforeSendHeaders = d => {
i < requestHeaders.length; i < requestHeaders.length;
i += 1, name = (requestHeaders[i] || {}).name i += 1, name = (requestHeaders[i] || {}).name
) { ) {
if (name === 'User-Agent' || name === 'user-agent') { name = name.toLowerCase();
if (name === 'user-agent') {
requestHeaders[i].value = str === 'empty' ? '' : str; requestHeaders[i].value = str === 'empty' ? '' : str;
}
// https://github.com/ray-lothian/UserAgent-Switcher/issues/160
else if (name.startsWith('sec-ch-')) {
requestHeaders[i] = null;
}
}
}
return { return {
requestHeaders requestHeaders: requestHeaders.filter(a => a)
}; };
}
}
}
}; };
const onCommitted = d => { const onCommitted = d => {