Skip to content

Commit 60e6df4

Browse files
authored
chore(bidi): don't set Accept-Language header for a locale override (#38196)
1 parent fef8251 commit 60e6df4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/playwright-core/src/server/bidi/bidiBrowser.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class BidiBrowserContext extends BrowserContext {
230230
userContexts: [this._userContextId()],
231231
}));
232232
}
233-
if (this._options.extraHTTPHeaders || this._options.locale)
233+
if (this._options.extraHTTPHeaders)
234234
promises.push(this.doUpdateExtraHTTPHeaders());
235235
await Promise.all(promises);
236236
}
@@ -330,9 +330,7 @@ export class BidiBrowserContext extends BrowserContext {
330330
}
331331

332332
async doUpdateExtraHTTPHeaders(): Promise<void> {
333-
let allHeaders = this._options.extraHTTPHeaders || [];
334-
if (this._options.locale)
335-
allHeaders = network.mergeHeaders([allHeaders, network.singleHeader('Accept-Language', this._options.locale)]);
333+
const allHeaders = this._options.extraHTTPHeaders || [];
336334
await this._browser._browserSession.send('network.setExtraHeaders', {
337335
headers: allHeaders.map(({ name, value }) => ({ name, value: { type: 'string', value } })),
338336
userContexts: [this._userContextId()],

packages/playwright-core/src/server/bidi/bidiPage.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,9 @@ export class BidiPage implements PageDelegate {
298298
}
299299

300300
async updateExtraHTTPHeaders(): Promise<void> {
301-
const locale = this._browserContext._options.locale;
302301
const allHeaders = network.mergeHeaders([
303302
this._browserContext._options.extraHTTPHeaders,
304303
this._page.extraHTTPHeaders(),
305-
locale ? network.singleHeader('Accept-Language', locale) : undefined,
306304
]);
307305
await this._session.send('network.setExtraHeaders', {
308306
headers: allHeaders.map(({ name, value }) => ({ name, value: { type: 'string', value } })),

0 commit comments

Comments
 (0)