Skip to content

Conversation

@pavelfeldman
Copy link
Member

No description provided.

const headers = this._page._state.extraHTTPHeaders || {};
if (contextOptions.language)
headers['Accept-Language'] = contextOptions.language;
promises.push(session.send('Network.setExtraHTTPHeaders', { headers }));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update wkPage.setExtraHTTPHeaders.

const value = headers[key];
assert(helper.isString(value), `Expected value of header "${key}" to be String, but "${typeof value}" is found.`);
this._state.extraHTTPHeaders[key.toLowerCase()] = value;
this._state.extraHTTPHeaders[key] = value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the referer logic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All done

@pavelfeldman pavelfeldman merged commit 8ed88c9 into microsoft:master Feb 13, 2020
@pavelfeldman pavelfeldman deleted the fe_setLang branch April 17, 2020 21:12
debs-obrien added a commit to debs-obrien/playwright that referenced this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants