Chris Burdess wrote:
Wolfgang Baer wrote:


In general you are right. However SUN clearly uses the key name in the Map returned by getHeaderFields() as it is and not lowercased. And there is nothing in the javadoc which would make a programmer assume that he must query with a lowercased name. So if programs use the getHeaderFields() returned Map not
only by iteration their code will break.


The solution would appear to be not to use a LinkedHashMap but some new class, similar to gnu.inet.http.Headers, that implements Map but does case-insensitive lookups on the keys (returning the header names in their original case in keySet() etc).

In order for the map to be at all useful, I would have to agree. However if we mimic Sun's brilliant implementation (as shown by Wolfgang's testing), we can (and must) just do it the easy way.

David Daney.


Reply via email to