Support multi-valued HTTP headers
Issue #252
resolved
HttpMessage needs to support multiple Set-Cookie headers as per the http specification.
Currently only one cookie is returned. (The last one found as headers are in a simple map).
Comments (7)
-
-
- changed title to Support multi-valued HTTP headers
Breaking change, for 6.0 release
-
- changed status to resolved
Implemented: c30600f8
To be released as v6.0 in couple of days
-
Hi this issue is not resolved yet. Currently only one value will be stored when processing the response received by HttpRequest.send() --> values.get(0). Currently this leads to problems as I'm loosing a 'Set-Cookie' value. :-(
// Set headers for (Map.Entry<String,List<String>> responseHeader: conn.getHeaderFields().entrySet()) { if (responseHeader.getKey() == null) { continue; // skip header } List<String> values = responseHeader.getValue(); if (values == null || values.isEmpty() || values.get(0) == null) { continue; // skip header } response.setHeader(responseHeader.getKey(), values.get(0)); }
All the best
Olaf
-
- changed status to open
Apparently it wasn't completely implemented. Stay tuned!
-
- changed status to resolved
Had been fixed in e6f0c5f and released as v6.1.1
-
Thanks a lot.
- Log in to comment
Would you be interested in submitting a PR?