lua-users home
lua-l archive

Re: luasocket.http and repeating headers

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
Just noticed that luasocket.http concatenates repeating headers with a
comma which makes them impossible to parse if the header value itself
contains a comma.
Do you have a specific case in mind? If so, please be more
specific. I believe cookies with dates can be parsed without
any problem, if that is what you are talking about.
Not all headers can be combined in this way. RFC 2616 says:
 Multiple message-header fields with the same field-name MAY be
 present in a message if and only if the entire field-value for that
 header field is defined as a comma-separated list [i.e., #(values)].
Looks like you cut the following lines in the quote that precisely
contradict your statement:
 Multiple message-header fields with the same field-name MAY
 be present in a message if and only if the entire
 field-value for that header field is defined as a
 comma-separated list [i.e., #(values)]. It MUST be possible
 to combine the multiple header fields into one "field-name:
 field-value" pair, without changing the semantics of the
 message, by appending each subsequent field-value to the
 first, each separated by a comma. The order in which header
 fields with the same field-name are received is therefore
 significant to the interpretation of the combined field
 value, and thus a proxy MUST NOT change the order of these
 field values when a message is forwarded.
Why the noise?
Regards,
Diego

AltStyle によって変換されたページ (->オリジナル) /