anlutro / php-curl

Simple PHP curl wrapper class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate headers

anlutro opened this issue · comments

From the HTTP 1.1 spec:

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.

To solve this, $response->getHeader($key) can return an array of headers, or it can combine the duplicate headers into a comma-separated one at runtime.

This is techncally a breaking change, but currently duplicate headers are merely overwritten in the response object which is a bug, so targetting a minor release.