mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(firefox): request body headers on redirect (#36068)
This commit is contained in:
parent
8fee17a225
commit
c472300a68
@ -27,13 +27,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox",
|
"name": "firefox",
|
||||||
"revision": "1485",
|
"revision": "1486",
|
||||||
"installByDefault": true,
|
"installByDefault": true,
|
||||||
"browserVersion": "137.0"
|
"browserVersion": "137.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox-beta",
|
"name": "firefox-beta",
|
||||||
"revision": "1481",
|
"revision": "1482",
|
||||||
"installByDefault": false,
|
"installByDefault": false,
|
||||||
"browserVersion": "138.0b10"
|
"browserVersion": "138.0b10"
|
||||||
},
|
},
|
||||||
|
@ -563,6 +563,30 @@ it('continue should propagate headers to redirects', {
|
|||||||
expect(serverRequest.headers['custom']).toBe('value');
|
expect(serverRequest.headers['custom']).toBe('value');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('continue should drop content-length on redirects', {
|
||||||
|
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/36029' }
|
||||||
|
}, async ({ page, server }) => {
|
||||||
|
await page.goto(server.EMPTY_PAGE);
|
||||||
|
|
||||||
|
await server.setRedirect('/redirect', '/empty.html');
|
||||||
|
await page.route('**/redirect', route => {
|
||||||
|
void route.continue({
|
||||||
|
headers: {
|
||||||
|
...route.request().headers(),
|
||||||
|
custom: 'value'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const [serverRequest] = await Promise.all([
|
||||||
|
server.waitForRequest('/empty.html'),
|
||||||
|
page.evaluate(url => fetch(url, { method: 'POST', body: 'foo' }), server.PREFIX + '/redirect')
|
||||||
|
]);
|
||||||
|
expect.soft(serverRequest.method).toBe('GET');
|
||||||
|
expect.soft(serverRequest.headers['content-length']).toBeUndefined();
|
||||||
|
expect.soft(serverRequest.headers['content-type']).toBeUndefined();
|
||||||
|
expect.soft(serverRequest.headers['custom']).toBe('value');
|
||||||
|
});
|
||||||
|
|
||||||
it('redirected requests should report overridden headers', {
|
it('redirected requests should report overridden headers', {
|
||||||
annotation: [
|
annotation: [
|
||||||
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31351' },
|
{ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31351' },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user