From 5b89338a35c6406f5af976017756e361f91ea9e2 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 19 Apr 2018 16:25:32 +0200 Subject: [PATCH] Clarify how Headers does not support Set-Cookie Fixes #345. --- fetch.bs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 106e51343..b9d957de4 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4384,9 +4384,16 @@ interface Headers { iterable<ByteString, ByteString>; }; +

Unlike a header list, a {{Headers}} object cannot represent more than one +`Set-Cookie` header. In a way this is problematic as unlike all other +headers `Set-Cookie` headers cannot be combined, but since `Set-Cookie` +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 +header list, as long as they also support an associated data structure for +`Set-Cookie` headers. +

-

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: +

A {{Headers}} object can be initialized with various JavaScript data structures:

 var meta = { "Content-Type": "text/xml", "Breaking-Bad": "<3" }