Set-Cookie response headers are merged in BiDi network events
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox160 fixed)
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
(Depends on 1 open bug)
Details
(Whiteboard: [webdriver:m22], [wptsync upstream][webdriver:relnote])
Attachments
(2 external files)
STRs:
- setup a server which returns several set-cookie headers
- listen for network response events with WebDriver BiDi (eg network.responseCompleted)
- send request
ER:
The network event should contain several individual headers with the name "set-cookie"
AR:
The network event contains only one set-cookie header, with values concatenated with \n
Fails a playwright test:
page/page-network-response.spec.ts :: should report multiple set-cookie headers
| Assignee | ||
Comment 1•1 year ago
|
||
In general, using visitOriginalResponseHeaders at https://searchfox.org/mozilla-central/rev/7d1b5c88343879056168aa710a9ee743392604c0/remote/shared/NetworkResponse.sys.mjs#249-253
this.#channel.visitResponseHeaders({
visitHeader(name, value) {
headers.push([name, value]);
},
});
would help with this issue. However, if we use this API, we no longer get the modified response headers if clients used network.continueRequest.
| Assignee | ||
Comment 2•1 year ago
|
||
Valentin, do you know if there is a way to get the "current" response headers, but avoid having headers such as Set-Cookie "flattened" as a single cookie? I feel like we would need another entry point here?
| Assignee | ||
Updated•1 year ago
|
Comment 3•1 year ago
|
||
Hi Julian,
This is a known issue with nsHttpHeaderArray - any headers that are not eVarietyResponseNetOriginal are saved in a merged form.
We recently addressed this issue in bug 1935948, though the fix was to split the cookie header by \n.
We've been talking about refactoring nsHttpHeaderArray for a while to address this limitation, but it might be a few months until we manage to land that. In the mean time, it should be OK to split the value by \n.
| Assignee | ||
Comment 4•2 months ago
|
||
While looking at current playwright failures, I think 3 playwright tests are currently failing because of this:
- page/page-network-response.spec.ts : should report multiple set-cookie headers
- library/har.spec.ts : should include set-cookies
- library/har.spec.ts : should include set-cookies with comma
| Assignee | ||
Comment 5•2 months ago
|
||
| Assignee | ||
Comment 6•2 months ago
|
||
| Assignee | ||
Comment 7•2 months ago
|
||
Hi Maksim, I wrote new tests to check that we properly expose each value for Set-Cookie response headers, and I noticed that Chrome is currently failing them. So I guess you must have the same implementation issue as we have on Firefox. I don't plan to land the new tests immediately, so that's just a heads up in case you have any feedback about this.
The WPT patch in D328644 LGTM. We'll align Chromium with the spec once the WPT lands.
| Assignee | ||
Comment 9•1 month ago
|
||
Thanks for checking Maksim!
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 10•1 month ago
|
||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/63574 for changes under testing/web-platform/tests
Comment 12•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d620ae064a58
https://hg.mozilla.org/mozilla-central/rev/369590a24497
Upstream PR merged by moz-wptsync-bot
| Assignee | ||
Updated•16 days ago
|
Description
•