-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Closed
Labels
Description
Context:
- Playwright Version: 1.19.2
- Operating System: Linux
- Node.js version: v16.13.0
- Browser: Chromium, Firefox
Code Snippet
const playwright = require('playwright');
(async () => {
const browser = await playwright.chrome.launchPersistentContext('', {
headless: false,
});
await browser.route('**/*', async (route, request) => {
try {
const response = await request.frame().page().request.fetch(route.request());
const responseHeaders = response.headers();
delete responseHeaders['set-cookie'];
console.log('route not yet fulfilled', (await browser.cookies()).length);
route.fulfill({
response,
headers: responseHeaders,
});
} catch {
route.abort('failed');
}
});
const page = await browser.newPage();
await page.goto('https://www.google.com/');
})();Describe the bug
Cookies get assigned despite the delete. Replacing set-cookie does not replace the original cookies.
Expected
route not yet fulfilled 0Actual
route not yet fulfilled 1