Steve Downey wrote: > 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.
I gave you the HTTP/1.1 answer. For Header H: A,B If A,B is semantically equivalent to: H: A H: B then you can parse for the comma. So since you can't know what the application considers to be semantically equivalent, the fact that it calls getHeaders is a big hint, and you can do the comma parsing. Please read the HTTP specification. >>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. You can also do it in MimeHeaders.values if you want to. Remy -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>