You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@gbiv.com> on 2015/10/27 19:17:45 UTC

Re: svn commit: r1710723 - in /httpd/httpd/trunk: CHANGES modules/cache/cache_util.h

> On Oct 26, 2015, at 11:45 PM, jailletc36@apache.org wrote:
> 
> Author: jailletc36
> Date: Tue Oct 27 06:45:03 2015
> New Revision: 1710723
> 
> URL: http://svn.apache.org/viewvc?rev=1710723&view=rev
> Log:
> RFC2616 defines #rules as:
>   #rule
>      A construct "#" is defined, similar to "*", for defining lists of
>      elements. The full form is "<n>#<m>element" indicating at least
>      <n> and at most <m> elements, each separated by one or more commas
>      (",") and OPTIONAL linear white space (LWS). This makes the usual
>      form of lists very easy; a rule such as
>         ( *LWS element *( *LWS "," *LWS element ))
>      can be shown as
>         1#element
> 
> It also defines Linear White Space (LWS) as:
>   LWS            = [CRLF] 1*( SP | HT )
> 
> 
> The actual implementation only accepts SP (Space) and not HT (Horizontal Tab) when parsing cache related header fields (i.e. "Vary", "Cache-Control" and "Pragma")

Well, to be more accurate: RFC7230 defines these (2616 no longer applies) and
the original algorithm did handle HT.  My bet is that someone screwed up an
automated TAB -> two space conversion and the code change got lost in the noise.

Your fix looks right, though.

....Roy


Re: svn commit: r1710723 - in /httpd/httpd/trunk: CHANGES modules/cache/cache_util.h

Posted by William A Rowe Jr <wr...@rowe-clan.net>.
On Tue, Oct 27, 2015 at 1:17 PM, Roy T. Fielding <fi...@gbiv.com> wrote:

> > On Oct 26, 2015, at 11:45 PM, jailletc36@apache.org wrote:
> >
> > Author: jailletc36
> > Date: Tue Oct 27 06:45:03 2015
> > New Revision: 1710723
> >
> > URL: http://svn.apache.org/viewvc?rev=1710723&view=rev
> > Log:
> > RFC2616 defines #rules as:
> >   #rule
> >      A construct "#" is defined, similar to "*", for defining lists of
> >      elements. The full form is "<n>#<m>element" indicating at least
> >      <n> and at most <m> elements, each separated by one or more commas
> >      (",") and OPTIONAL linear white space (LWS). This makes the usual
> >      form of lists very easy; a rule such as
> >         ( *LWS element *( *LWS "," *LWS element ))
> >      can be shown as
> >         1#element
> >
> > It also defines Linear White Space (LWS) as:
> >   LWS            = [CRLF] 1*( SP | HT )
> >
> >
> > The actual implementation only accepts SP (Space) and not HT (Horizontal
> Tab) when parsing cache related header fields (i.e. "Vary", "Cache-Control"
> and "Pragma")
>
> Well, to be more accurate: RFC7230 defines these (2616 no longer applies)
> and
> the original algorithm did handle HT.  My bet is that someone screwed up an
> automated TAB -> two space conversion and the code change got lost in the
> noise.
>

Interestingly it was only introduced in a recent commit (2 yrs ago) with
the defect,
one might guess that the vi/emacs template did the damage when the text was
pasted in.

See also server.c/protocol.c@920 on trunk, which has the correct HT
handling,
explicitly.