On Saturday 17 August 2002 09:00 am, Remy Maucherat wrote:
> 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
>
> No, this is not correct.
>
> You are allowed to do that only if the application knows it makes sense
> to do so (ie, only when it call getHeaders).
>

If it is to be done, it should be done based on what the HTTP/1.1 spec 
defines. The application needs to expect the possibility of multiple values 
for all of the headers that allow them. Or just ask for the first one. 
Parsing the header line into values probably shouldn't be left to the 
application, although it is at the moment.

> Some code to do that should be added in the adapter.
>

Do you mean in the implementation of HttpServletRequest? I was thinking of 
doing the work in MimeHeaders. Perhaps subclassing MimeHeaders into 
Http11Headers, in order to allow other RFCnnnnHeaders? Certainly 
Http11Protocol knows what kind of headers it's parsing. 

> > 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?
>
> No, this musn't be done there, as it would screw up many headers. Please
> read the chapter on multivalued headers in the HTTP/1.1 spec.
>

Right, at the lowest level, headers are being handled generically. Something 
needs to be aware of the semantics of HTTP/1.1 headers.

> Remy


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

Reply via email to