Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(webkit): introduce BrowserContext({language}) #972

Merged
merged 1 commit into from Feb 13, 2020

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.

@@ -272,7 +272,7 @@ export class Page extends platform.EventEmitter {
for (const key of Object.keys(headers)) {
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
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.

None yet

2 participants