Message292263
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 |
|
Date |
User |
Action |
Args |
2017-04-25 14:44:44 | jugglinmike | set | recipients:
+ jugglinmike, docs@python |
2017-04-25 14:44:44 | jugglinmike | set | messageid: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za> |
2017-04-25 14:44:44 | jugglinmike | link | issue30160 messages |
2017-04-25 14:44:44 | jugglinmike | create | |
|