nodejs/http2

http2: cookies

sebdeckers opened this issue · 5 comments

The set-cookie header may appear multiple times. Its values should be handled as an Array in all response header methods.

heh... great minds think alike... #115
I was just working on this :-)

well... same area. at least :-) .. the mapToHeaders function was not handling multi-valued headers appropriately. This should fix that.

@jasnell Hah, awesome!

If the HTTP/2 API supports duplicate headers for any header, the compatibility layer may need to mimic the old behaviour described in message.headers:

Duplicates in raw headers are handled in the following ways, depending on the header name:

  • Duplicates of age, authorization, content-length, content-type, etag, expires, from, host, if-modified-since, if-unmodified-since, last-modified, location, max-forwards, proxy-authorization, referer, retry-after, or user-agent are discarded.
  • set-cookie is always an array. Duplicates are added to the array.
  • For all other headers, the values are joined together with ', '.

yeah, for the first point, we may need to enforce that at a lower level... not just in the compat layer.

Fixed in #115 (related: #129)