Hi.
Following another thread with the subject "How to programmatically add
parameters to ServletRequest objects?", I have a couple follow-up questions.
This is related to a HttpServletRequestWrapper-derived class I wrote for
a filter. I would like to make sure of precisely how I have to handle
the HTTP request headers in my filter.
A-prioris :
- Some HTTP headers may occur several times in an HTTP request.
- According to the HTTP 1.1 RFC, HTTP headers names are
case-insensitive, and "Accept-charset:", "ACCEPT-CHARSET:",
"Accept-Charset:" are thus equivalent.
1) The ServletHttpRequest.getHeaderNames() method returns an Enumeration
(of request header name strings).
Does getHeaderNames() always "fold" equivalent HTTP headers of the same
name into one single entry, or can it happen that the Enumeration
contains the same name several times ?
What when there are two request headers with essentially the same name,
but varying in the "case" of the header name in the original request ?
Like
Accept-charset:
Accept-Charset:
Does .getHeaderNames() then return one single entry for both of the
above, or two ? and if only one, which of the above "spellings" would it
return ?
2) (may overlap the above) Does Tomcat fold the header names internally
to upper- or lower-case ?
3) the ServletHttpRequest.getHeader(string name) also returns an
Enumeration (of header string values).
Do .getHeader("abc"), and .getHeader("ABC") always return the same
Enumeration ?
In other words, is it guaranteed that with one call, the Enumeration
returned contains all values of all HTTP headers having that name,
independently of the original header's case and independently of how the
parameter "name" is passed ?
3) Is the above implementation-dependent (e.g. Tomcat vs Websphere), or
is it an essential part of the servlet specification, which can be
relied upon to work under any servlet container ?
Thanks in advance,
André
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]