I try to rewrite the Header below:
await page.setExtraHTTPHeaders({
"Accept-Language": "en-US;q=0.7",
});
However, when I inspect the network in Chrome, the request header is accept-language
instead.
I expect it to be Accept-Language
.
Any advice? Thanks.
I manage to work around with interception of the request like below:
await page.setRequestInterception(true);
page.on("request", request => {
// Override headers
const headers = Object.assign({}, request.headers(), {
"Accept-Language": "en-US;q=0.7",
});
request.continue({ headers });
});