Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 50866 invoked from network); 18 Aug 2002 13:26:09 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 18 Aug 2002 13:26:09 -0000 Received: (qmail 14129 invoked by uid 97); 18 Aug 2002 13:26:29 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 14105 invoked by uid 97); 18 Aug 2002 13:26:28 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 14093 invoked by uid 98); 18 Aug 2002 13:26:27 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Content-Type: text/plain; charset="iso-8859-1" From: Steve Downey To: "Tomcat Developers List" Subject: Re: Watchdog aggregation of headers may be incorrect Date: Sun, 18 Aug 2002 09:24:11 -0400 User-Agent: KMail/1.4.1 References: <200208162135.27666.steve.downey@netfolio.com> <200208171754.11023.steve.downey@netfolio.com> <3D5F9565.7050204@apache.org> In-Reply-To: <3D5F9565.7050204@apache.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200208180924.11870.steve.downey@netfolio.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Sunday 18 August 2002 08:39 am, Remy Maucherat wrote: > Steve Downey wrote: > > On Saturday 17 August 2002 01:40 pm, Remy Maucherat wrote: > >>Steve Downey wrote: > > > > > > > >>>The real problem, for the servlet spec implementation, is that not j= ust > >>>getHeaders() is affected. getHeader() must be also. getHeader, if th= ere > >>>are multiple values, needs to return the same thing as the first val= ue > >>>returned by getHeaders(), not the whole header from the first of > >>> multiple headers. > >> > >>Sorry, but no. The opposite statement doesn't work. > >>getHeader MUST return the first header line, unless in the case there > >>are multiple headers with the same name in the client message, in whi= ch > >>case you would know that they can be parsed/combined at will. > >> > >>Since it is too complex and inefficient to implement that, I'd leave = it > >>at that, and let the application handle the cases where the client is > >>having some fun. > >> > >>Remy > > > > Given: > > H:A,B > > H:C > > > > getHeader() should either return ``A'' or ``A,B,C''. Returning ``A,B'= ', > > as it does now, can't be right. It introduces semantic differences > > between multiple headers and comma-separated lists where their must b= e > > none. > > Yes, it is right. > > Consider: > H: A, B > > In that case, getHeader() has to return "A, B" since it is not known if > this header is comma separated, as per the spec definition. > Ah. That's where we're going in separate directions. I'm assuming that it= is=20 known. The HTTP spec defines which headers are comma separated. So it's j= ust=20 a matter of checking against that list in order to know how to treat mult= iple=20 values. According to the current servlet spec we have to, since we need t= o=20 parse out the values for headers that are comma separated lists.=20 getHeaders("Date") should not break apart the date into two values. > In the case: > H: A, B > H: C > > Well, you have multiple choices, all of which are valid. > - you may want to return the same thing as above, which means you retur= n > "A, B" > - you can also return "A" > > Returning "A, B, C" is incorrect, as you have to return the first value > of the header. > Since implementing the first option is easier, I'd leave the current > behavior. > > getHeaders indicate that the header is comma separated, so it should be > parsed. This is not currently done, but indeed it should be done. > Hacking MimeHeaders can result in a correct *and* efficient implementat= ion. > getHeaders() by itself doesn't tell you that the header is comma separate= d.=20 getHeaders("Date") should give you "Wed, 15 Nov 1995 06:25:24 GMT", not=20 {"Wed", "15 Nov 1995 06:25:24 GMT"}.=20 -- To unsubscribe, e-mail: For additional commands, e-mail: