Are you sure? Well, of course you're sure. What I mean is, is this a 
good interpretation of the spec?

The spec is not crystal clear on this point [SRV.4.3], as it discusses 
multiple headers with the same name, and multiple values for headers, 
but that seems to be within context of multiple headers. And in the API 
description [SRV.15.1.3], it discusses the contrary case, where a header 
such as Accept-Language may be sent multiple times, rather than being 
sent as a comma separated list.

The problem is, I don't see a good way of disambiguating, for example, a 
date header and a multiple value header. Not without being aware of the 
content models for all of the spec'd http headers. Or possibly just the 
list that allows for multiple values.

The underlying implementation is o.a.t.util.MimeHeader. It parses, in a 
fairly generic way, RFC822 style headers from MessageBytes. The results 
are passed through untouched in the various wrappers and facades. Unless 
I missed something.

If Tomcat 4 did this until a few months ago, I'll take a look at the old 
code.

Patrick Luby wrote:

> Steve,
>
> Your assessment is correct: an aggregate header like:
>
>   header1: val1, val2
>
> should be converted to this for the HttpRequest:
>
>   header1: val1
>   header1: val2
>
> Tomcat 4 used to do this conversion correctly but then it stopped 
> doing the conversion a few months ago.
>
> This should be fixed as it is Servlet spec non-compliance. However, I 
> am not sure where the parsing of headers is now performed in Tomcat?
>
> Can anyone point Steve to where this header parsing of the 
> ServerSocket input stream is being done?
>
> Patrick
>
> Steve Downey wrote:
>
>> Watchdog now merges headers, by design. ie (from the checking message)
>> Modified logic to send duplicate headers as one aggregated header vs. 
>> two headers:
>>
>>   header1: val1
>>   header1: val2
>>
>>    -will now be-
>>
>>   header1: val1, val2
>>
>> Due to this, it looks like a couple of tests are failing. 
>> GetHeadersTest and HttpServletRequestWrapperGetHeadersTest.
>> GetHeadersTest looks for two Accept-Language headers, en-us and 
>> ga-us. It does work if they are sent as
>> Accept-Language:en-us
>> Accept-Language:ga-us
>>
>> But, being sent as:
>> Accept-Language:en-us, ga-us
>>
>> it is presented to the servlet as ONE header, with the value "en-us, 
>> ga-us"
>>
>> However, I'm not sure that it shouldn't be. Parsing a multivalued 
>> header is not only diffcult, it seems to depend on which header is 
>> being parsed. Certainly full interpretation is very dependent on the 
>> header, e.g.
>> Accept-Language: da, en-gb;q=0.8, en;q=0.7
>> Date: Wed, 15 Nov 1995 06:25:24 GMT
>>
>> The first has three values, the second has one. Interpretation 
>> depends on the name of the header. I don't believe the 
>> Request.getHeaders() mechanism should try and interpret the values 
>> after the :.
>>
>>
>>
>>
>> -- 
>> To unsubscribe, e-mail:   
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: 
>> <mailto:[EMAIL PROTECTED]>
>
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to