http.request: handling of duplicated headers should be documented
It is common to have multiple headers with the same title in an HTTP response. For example, consider Set-Cookie.
In the receiveheaders function, I see this code:
I am not sure if this practice is sort of standard, but it is not obvious and should be documented.
https://lunarmodules.github.io/luasocket/http.html#request
as per http spec. header values can be comma separated in a single header, or appear multiple times. This just makes them appear once, in CSV format.
as per http spec. header values can be comma separated in a single header, or appear multiple times. This just makes them appear once, in CSV format.
As the OP notes: some headers (such as Set-Cookie) must not be comma-concatenated as that would change semantics
yup, that's right.
So then probably no combining should be done at all. The common way to handle would be to have the value become an array with mutliple entries. But that would be breaking 🤔