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 jugglinmike
Recipients docs@python, jugglinmike
Date 2017-04-25.14:44:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation for BaseHTTPRequestHandler explicitly prohibits protocol
violations when writing to the `wfile` stream:

> BaseHTTPRequestHandler has the following instance variables:
>
> [...]
>
> **`wfile`**
>
> > Contains the output stream for writing a response back to the client.
> > Proper adherence to the HTTP protocol must be used when writing to this
> > stream.

I am interested in testing web browser behavior in response to protocol
violations, and my initial interpretation of this text (and the term "must" in
particular) is that such conditions are not guaranteed to achievable with this
module. However, my colleague believes the text is simply intended to
communicate that there is no safety mechanism in place, and that protocol
violations will not be corrected. [1]

Local testing and a quick reading of the source tends to confirm the latter
interpretation, but this may simply be coincidental and not necessarily stable
behavior.

If it is in fact stable, then I would like to request a modification to the
documentation. Changing the word "must" to "should" would help, although it
might be better to be more explicit--something like, "Bytes are transmitted
'as-is'; HTTP protocol violations will not be corrected."

Thanks!

[1] https://github.com/w3c/web-platform-tests/issues/5668
History
Date User Action Args
2017-04-25 14:44:44jugglinmikesetrecipients: + jugglinmike, docs@python
2017-04-25 14:44:44jugglinmikesetmessageid: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za>
2017-04-25 14:44:44jugglinmikelinkissue30160 messages
2017-04-25 14:44:44jugglinmikecreate