http_headers class doesn't allow multiple instances of the same header
There are cases during proxy authentication where a proxy will offer multiple authentication methods to a client.
eg. `HTTP/1.1 407 Please authenticate
Proxy-Authenticate: NTLM
Proxy-Authenticate: Basic realm="/" `
In this case the response contains multiple Proxy-Authenticate headers with different values. The way that the http_headers class is implemeted using a std::map as the storage for the associative data means that muliple instances of the same header cannot be represented.
This to me seems like a design flaw. Would you accept a PR fixing this?
Thanks, Chris
Another RFC that explicitly calls for multiple headers of the same name: https://tools.ietf.org/html/draft-snell-http-prefer-14
Closing this issue. It seems that cpprestsdk is handling this according to 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. 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.
When you look what the http_header::add member does, it does indeed build up a comma separated value list. So, a consumer is free to parse that out.