Chore summary
Currently the type for IHttpRequest.headers is just string. This is good because even if a header of the particular name appears several times inside the request, they will be concatenated using , (see https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2).
However, this is not true for Set-Cookie which is not concatenated due to its internal format. Specifically, the expires can contain , already.
Example: Set-Cookie: id=a3fWa; Expires=Wed, 21 Oct 2015 07:28:00 GMT
The goal of this task is to make headers a string | string[] and update all the dependent code.
Tasks
Additional context
Based on discussion here: https://github.com/stoplightio/platform-internal/pull/1279/files#r391020707
Chore summary
Currently the type for
IHttpRequest.headersis juststring. This is good because even if a header of the particular name appears several times inside the request, they will be concatenated using,(see https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2).However, this is not true for
Set-Cookiewhich is not concatenated due to its internal format. Specifically, the expires can contain,already.Example:
Set-Cookie: id=a3fWa; Expires=Wed, 21 Oct 2015 07:28:00 GMTThe goal of this task is to make
headersastring | string[]and update all the dependent code.Tasks
http.tsAdditional context
Based on discussion here: https://github.com/stoplightio/platform-internal/pull/1279/files#r391020707