Skip to content

Commit

Permalink
chore(bidi): Fix handling of cookie headers in network.continueRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
juliandescottes committed Jan 9, 2025
1 parent 01ba528 commit d7ba4b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,9 @@ function fromBidiHeaders(bidiHeaders: bidi.Network.Header[]): types.HeadersArray
return result;
}

function toBidiRequestHeaders(allHeaders: types.HeadersArray): { cookies: bidi.Network.CookieHeader[], headers: bidi.Network.Header[] } {
function toBidiRequestHeaders(allHeaders: types.HeadersArray): { headers: bidi.Network.Header[] } {
const bidiHeaders = toBidiHeaders(allHeaders);
const cookies = bidiHeaders.filter(h => h.name.toLowerCase() === 'cookie');
const headers = bidiHeaders.filter(h => h.name.toLowerCase() !== 'cookie');
return { cookies, headers };
return { headers: bidiHeaders };
}

function toBidiResponseHeaders(headers: types.HeadersArray): { cookies: bidi.Network.SetCookieHeader[], headers: bidi.Network.Header[] } {
Expand Down
2 changes: 1 addition & 1 deletion tests/page/page-route.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ it('should properly return navigation response when URL has cookies', async ({ p

it('should override cookie header', async ({ page, server, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16773' });
it.fail(browserName !== 'firefox');
it.fail(browserName !== 'firefox' && browserName !== '_bidiFirefox');

await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => document.cookie = 'original=value');
Expand Down

0 comments on commit d7ba4b4

Please sign in to comment.