Context:
- Playwright Version: 1.0.2
- Operating System: Windows
- Node version: 14.2.0
- Browser: chromium
Code Snippet
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext();
await context.route('**/*', async route => {
route.fulfill({
status: 200,
headers: {
x: 'a\nb',
},
body: '<h1>Title</h1>',
});
});
const page = await context.newPage();
await page.goto('http://localhost/');
console.log(await page.content());
await browser.close();
})();
Describe the bug
route.fulfill hang if fed with response containing newline in its value but on the other hand response.headers() joins multiple headers (like multiple set-cookie headers) into a single line separated with newline.
set-cookie: a
set-cookie: b
becomes
when fetch via response.headers().
I think there should be a standard on how to handle header field with multiple values. Having it returns and receive Array is better in my opinion.