I am debugging some code in the Selenium-rc proxy server. It seems the culprit is the HttpURLConnection object, whose interface for getting at the HTTP headers does not cope with duplicate header names, such as:
Set-Cookie: foo=foo; Path=/ Set-Cookie: bar=bar; Path=/
The way of getting at the headers through the HttpURLConnection(using getHeaderField(int n) and getHeaderFieldKey(int n)) seems to be causing my second cookie to be lost. My question is
- Is it true that HttpURLConnection itself can't cope with it, and
- If so, is there a workaround to it?