diff options
Diffstat (limited to 'org.eclipse.jgit.http.apache/src/org')
-rw-r--r-- | org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java index 7f1fecb9bf..77c5dc0f3e 100644 --- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java +++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java @@ -272,10 +272,14 @@ public class HttpClientConnection implements HttpConnection { public Map<String, List<String>> getHeaderFields() { Map<String, List<String>> ret = new HashMap<>(); for (Header hdr : resp.getAllHeaders()) { - List<String> list = new LinkedList<>(); - for (HeaderElement hdrElem : hdr.getElements()) + List<String> list = ret.get(hdr.getName()); + if (list == null) { + list = new LinkedList<>(); + ret.put(hdr.getName(), list); + } + for (HeaderElement hdrElem : hdr.getElements()) { list.add(hdrElem.toString()); - ret.put(hdr.getName(), list); + } } return ret; } |