Ticket #2346: HTTP header generation in web2 according to RFC822

Hi all, tekNico and I found a problem with the web2 headers generation code. We opened the ticket #2346 with a patch to the testcase and a patch to web2.http_headers. We are not sure we correctly deciphered RFC 822, where it says: quoted-string = <"> *(qtext/quoted-pair) <"> qtext = <any CHAR excepting <">, "\" & CR, and including linear-white-space> quoted-pair = "\" CHAR Should the "&" character be construed as a linguistic comma: qtext = qtext.replace('\r', '\\\r') or as a logic AND? qtext = qtext.replace('\\\r', '\\\\\r') Thanks.

Have a look at section 3.4.1 (Clarifications>>Quoting): Within these constructs, quoting is REQUIRED for CR and "\" and for the character(s) that delimit the token (e.g., "(" and ")" for a comment). So, they're saying to backslash escape CR, "\" and double-quote for quoted-strings. HTH, --Grant On 2 Jan, 2007, at 09:19, david mugnai wrote:
Hi all,
tekNico and I found a problem with the web2 headers generation code.
We opened the ticket #2346 with a patch to the testcase and a patch to web2.http_headers.
We are not sure we correctly deciphered RFC 822, where it says:
quoted-string = <"> *(qtext/quoted-pair) <"> qtext = <any CHAR excepting <">, "\" & CR, and including linear- white-space> quoted-pair = "\" CHAR
Should the "&" character be construed as a linguistic comma:
qtext = qtext.replace('\r', '\\\r')
or as a logic AND?
qtext = qtext.replace('\\\r', '\\\\\r')
Thanks.
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

david mugnai wrote:
tekNico and I found a problem with the web2 headers generation code.
We opened the ticket #2346 with a patch to the testcase and a patch to web2.http_headers.
We reworked the fix and the tests according to the suggestions of jknight. Is it good enough now? -- Nicola Larosa - http://www.tekNico.net/ Mochikit is well designed and well thought out, and Python/Twisted/Nevow developers will definitely find its API very familiar. [...] Mochikits's capabilities will probably surprise you -- the createDOM function, iteration tools and the asynchronous architecture are a work of art. -- Dan Webb, June 2006
participants (3)
-
david mugnai
-
Grant Baillie
-
Nicola Larosa