This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pje
Recipients Alan.Braithwaite, pitrou, pje, serhiy.storchaka, tanner
Date 2014-12-09.18:50:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CALeMXf5eMKbe-7hLEEONYLzRS-iUec-VYf7Z5==mJAb=XA9dKg@mail.gmail.com>
In-reply-to <1418140702.32.0.156256649738.issue21114@psf.upfronthosting.co.za>
Content
The fix for the server looks ok, but the validation and tests must not
be changed, since they void spec compatibility and aren't a bug fix
(and so must not be added to 2.7.)  Indeed, if the validation library
*doesn't* fail on CRLF, then *that* would be a bug, since it's
supposed to tell you about every verifiable spec violation.

Also, simple_server *should* unfold multiline headers, if it's not
already doing so.  (If it's not, it is a bug and can therefore be
fixed in 2.7.)

On Tue, Dec 9, 2014 at 10:58 AM, Tom Tanner <report@bugs.python.org> wrote:
>
> Tom Tanner added the comment:
>
> This is actually more complicated than I initially thought.
> According to https://www.python.org/dev/peps/pep-3333/#the-start-response-callable
> "Each header_value must not include any control characters, including carriage returns or linefeeds, either embedded or at the end. (These requirements are to minimize the complexity of any parsing that must be performed by servers, gateways, and intermediate response processors that need to inspect or modify response headers.) "
>
> There's a discussion at https://mail.python.org/pipermail/web-sig/2006-September/002244.html
>
> It think the spec should be changed as parsing multi-line headers is really simple and sometimes necessary (e.g., when passing the X.509 client certificate).
>
> Anyway, attached you find a patch for Python 2.7.8 which includes a test and allows CR/LF in header values.
>
> ----------
> Added file: http://bugs.python.org/file37401/wsgi.diff
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue21114>
> _______________________________________
History
Date User Action Args
2014-12-09 18:50:05pjesetrecipients: + pje, pitrou, serhiy.storchaka, Alan.Braithwaite, tanner
2014-12-09 18:50:05pjelinkissue21114 messages
2014-12-09 18:50:04pjecreate