views:

276

answers:

1

Hi!

Since is made aware of the fact that HTTP headers are case-insensive according to the RFC, i wonder how to handle this problem with Servlets. There is a #getHeader(String) method to obtain a header but it turned out that this method treats the header fields case sensive which is quite... annoying?

Is there a proper way to obtain the contents of a header field in a case insensive manner? Or do i have to iterate over all header fields provided by the client to find the header is was looking for?

Have a great weekend!

+2  A: 

Which servlet container are you using? The docs for getHeader(String) state:

The header name is case insensitive.

so it sounds like a bug in the container you're using.

Jon Skeet
Actually, its Jetty 5. I'll investigate this issue, thank for pointing me to the Java EE documentation... ;-)
Malax
I think Jetty might be up to version 6 (or 7?), you might want to take a look at upgrading.
matt b