Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] HttpConnection: Way of accessing the response headers in a case-insensitive way

Hi together,
I am currently preparing a patch for https://bugs.eclipse.org/bugs/show_bug.cgi?id=488572 (i.e. supporting cookies for HTTP-based git operations).

Currently I am struggling with https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java.
The only relevant methods for exposing response headers (for evaluating the "set-cookie"/"set-cookie2" header) are either 

1. getHeaderField (https://github.com/eclipse/jgit/blob/c567b6ecde6b055441f52f0f36dcf8b9d0fe5068/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java#L236), which has the drawback that this always return only the first header with the given name. Also the header name is not case-insensitive or
2. getHeaderFields (https://github.com/eclipse/jgit/blob/c567b6ecde6b055441f52f0f36dcf8b9d0fe5068/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java#L147, which suffers also from the fact that this returns a map where you cannot predict whether the keys are upper-case or lower-case or arbitrarily mixed.

What would be your suggestion on how to evaluate the "set-cookie" response header without being forced to enrich the HttpConnection interface?

Thanks for any input,
Konrad




Back to the top