[Fetch API] Implement `Headers.prototype.getSetCookie`
Categories
(Core :: DOM: Networking, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: abotella, Assigned: abotella)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
Spec PR: https://github.com/whatwg/fetch/pull/1346
Test PR: https://github.com/web-platform-tests/wpt/pull/31442
The proposed getSetCookie()
method of the Headers
class allows getting a list of the values of the Set-Cookie
header in the header list. This was not possible before, since the get()
method would combine the values by joining them with comma and whitespace, which is valid per the HTTP spec, but clashes with Set-Cookie
syntax.
The spec change that introduces this method also changes the iteration behavior for Headers
to have each Set-Cookie
header show up in the iteration, rather than having them combined.
The fetch spec's Request
and Response
classes don't allow setting the Set-Cookie
header, and fetch
will remove that header from the returned Response
. This change to the spec does not change this. It only makes it so a user-created Headers
class can deal with Set-Cookie
headers in an easier way, and enables compatibility with server-side runtimes which allow these headers.
Assignee | ||
Comment 1•2 years ago
|
||
This patch implements the getSetCookie()
method of the fetch spec's
Headers
interface, which allows getting a list of the values in the
Set-Cookie
header that are present in the header list. This was not
possible before, since the get()
method would combine the values by
joining them with comma and whitespace, which is valid per the HTTP
spec, but clashes with Set-Cookie
syntax.
The spec change that introduces this method also changes the iteration
behavior for Headers
to have each Set-Cookie
header show up in the
iteration, rather than having them combined, and this patch also
modifies InternalHeaders::MaybeSortList
to implement that change.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 3•2 years ago
|
||
bugherder |
Description
•