Re: parsing quoted-string HTTP header fields

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 25 May 2011 23:51:57 +1200

On 25/05/11 22:44, Tsantilas Christos wrote:
> The quoted string fields parsing done in squid3 using the
> httpHeaderParseQuotedString function (HttpHeaderTools.cc file)
>
> I found that we do not support multiline quoted string fields, but
> according the rfc2616 multiline quoted string fields should supported:
>
> quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
> qdtext = <any TEXT except <">>
> TEXT = <any OCTET except CTLs,
> but including LWS>
> LWS = [CRLF] 1*( SP | HT
>
>
>
> I am planning to fix the httpHeaderParseQuotedString function, using one
> of the following rules:
>
> 1) Just ignore any "\r" or "\n" character. This is the fastest and
> simpler approach
> 3) Require "\r\n " or "\r\n\t" as line separator and just remove the "\r\n"
> 3) Require "\r\n " or "\r\n\t" as line separator and replace it with a
> space
> 4) Also support "\n\t" or "\n\n\t" as line separators.

(4) case #2 "\n\n\t" is also non-compliant.

>
> Any comments or suggestions?

RFC states "A recipient MAY replace any linear white space with a single
SP".

So (1) and the second (3) {replace with 0x20} are the valid options.

It may be worth having two quoted-string parsers. One for each option.
The preference being (1) for its higher performance.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.12
   Beta testers wanted for 3.2.0.7 and 3.1.12.1
Received on Wed May 25 2011 - 11:52:04 MDT

This archive was generated by hypermail 2.2.0 : Wed May 25 2011 - 12:00:05 MDT