From 32ecb07f64230e51c55ca2b12ee9ef8264055364 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 22 Dec 2023 14:31:41 -0800 Subject: [PATCH] test: route.continue headers are propagated to redirected requests (#28771) Failing test for https://github.com/microsoft/playwright/issues/28758 --- tests/page/page-request-continue.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.ts index da9380781e..30d47b0c88 100644 --- a/tests/page/page-request-continue.spec.ts +++ b/tests/page/page-request-continue.spec.ts @@ -393,6 +393,25 @@ it('should continue preload link requests', async ({ page, server, browserName } expect(color).toBe('rgb(255, 192, 203)'); }); +it('continue should propagate headers to redirects', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28758' }); + it.fixme(browserName !== 'webkit'); + 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.goto(server.PREFIX + '/redirect') + ]); + expect(serverRequest.headers['custom']).toBe('value'); +}); + it('should intercept css variable with background url', async ({ page, server }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/19158' });