/ Zope / Apsis / Pound Mailing List / Archive / 2004 / 2004-10 / [PATCH] Http 1.1 header regex

[ << ] [ >> ]

[ new -current / Robert Segall ... ] [ Slow download connection though pound / ... ]

[PATCH] Http 1.1 header regex
Olivier Dormond <olivier(at)mnc.ch>
2004-10-21 16:42:12 [ FULL ]
Hello everyone!

 I started to use pound for routing wap requests and discovered that it
dropped some headers produced by the operator's wap gateway.

 I've seen these two special header being rejected in the logs:

13-profile: <url of an xml file describing the mobile device
capabilities>

X-WAP.TOD: 00

 I don't care for the second one as I don't know what it means but
the first one is very handy.

 After looking at the code and RFC 2616 I discovered that pound did not
accept the full set of valid headers. Pound only accept headers with
a field-name starting with a letter and followed by any number of letters,
digits, underscores or hyphens. But according to the RFC 2616 a valid
field-name is made of at least one ASCII character except the control
characters (0 - 31 and 127) and the seperators which are:

       separators     = "(" | ")" | "<" | ">" | "(at)"
                      | "," | ";" | ":" | "\" | <">
                      | "/" | "[" | "]" | "?" | "="
                      | "{" | "}" | SP | HT

 So I made the attached patch which remove the constraint on the first char
being a letter and add these chars in the allowed set: .!#%&'`^~$*+|

Cheers,

                Olivier
[...]

RE: [PATCH] Http 1.1 header regex
"John Hansen" <john(at)oztralis.com.au>
2004-10-21 22:54:27 [ FULL ]
I think you forgot to attach the patch :)

... John 
[...]

Re: [PATCH] Http 1.1 header regex
Robert Segall <roseg(at)apsis.ch>
2004-10-22 09:06:23 [ FULL ]
On Thursday 21 October 2004 16.42, Olivier Dormond wrote:[...]

OK - I added it to the main branch, but given my misgivings about this I put 
it under conditional compilation. You'll have to ./configure --enable-unsafe 
to activate it.

New -current available on the Pound page - as always try it and let us
know.[...]

MailBoxer