[issue36274] http.client cannot send non-ASCII request lines
Jason R. Coombs
report at bugs.python.org
Wed Sep 11 07:50:34 EDT 2019
Jason R. Coombs <jaraco at jaraco.com> added the comment:
Thank you Tim for the reasoned issue and proposed solutions.
After reviewing these proposals with @eric.snow, we've decided that this approach is dangerous in that the proposed approaches has the potential to expose users unexpectedly to non-compliant behavior, where as currently they are assured compliance. Instead, we would like to see a more explicit opt-in, such as through a separate method or through a setting on the call and/or client object.
Consider instead a solution that implements both `.putrequest` and `.putrequest_raw` or `.putrequest_allow_invalid_bytes` that sends a clear signal to the user that they're bypassing the default protections.
Or consider another approach where HTTPConnection implements an `_encode_request()` method that a subclass with a specialized need could override.
Would either of those approaches suit your use-case?
----------
nosy: +eric.snow, jaraco
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36274>
_______________________________________
More information about the Python-bugs-list
mailing list