ForceCORS icon indicating copy to clipboard operation
ForceCORS copied to clipboard

Fixed bug when multiple headers have the same name

Open vthibault opened this issue 7 years ago • 0 comments

I encounter the case where servers send me the same header multiple time leading to problems with the extension (ForceCors just updating the first header entry, not the next ones).

From RFC

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.

This pull request merge (or erase) the headers before replacing them by our custom list to avoid the previously discussed problem.

vthibault avatar Jun 07 '17 13:06 vthibault