Skip to content

Commit

Permalink
Clarify how Headers does not support Set-Cookie
Browse files Browse the repository at this point in the history
Fixes #345.
  • Loading branch information
annevk committed Apr 19, 2018
1 parent 8193ffe commit 5b89338
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4384,9 +4384,16 @@ interface Headers {
iterable<ByteString, ByteString>;
};</pre>

<p class=note>Unlike a <a>header list</a>, a {{Headers}} object cannot represent more than one
`<code>Set-Cookie</code>` <a for=/>header</a>. In a way this is problematic as unlike all other
headers `<code>Set-Cookie</code>` headers cannot be combined, but since `<code>Set-Cookie</code>`
headers are not exposed to client-side JavaScript this is deemed an acceptable compromise.
Implementations could chose the more efficient {{Headers}} object representation even for a
<a>header list</a>, as long as they also support an associated data structure for
`<code>Set-Cookie</code>` headers.

<div class=example id=example-headers-class>
<p>Constructing a {{Headers}} object from scratch is fairly straightforward. You could pass in a
JavaScript object representing a header hash map, or an array of ordered pairs:
<p>A {{Headers}} object can be initialized with various JavaScript data structures:

<pre>
var meta = { "Content-Type": "text/xml", "Breaking-Bad": "&lt;3" }
Expand Down

0 comments on commit 5b89338

Please sign in to comment.