Issue
Since I discovered that HTTP headers are case-insensive according to the RFC, i was wondering how I can access HTTP headers in a case-insensitive way with Servlets. There is a #getHeader(String) method to obtain a header but it turned out that this method treats the header fields case sensitive.
Is there a "case insensitive" way to get header fields ? Or do i have to iterate over all the header fields to find the header field I was looking for ?
Solution
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.
Answered By - Jon Skeet