Closed dpetukhov closed 7 years ago
FWIW, as a note to myself, the UnicodeDecodeError doesn't occur under Python 2, only under Python 3.
What about modifying the test in the way that I suggested in this pull request #162 ?
Thank you @bertjwregeer !
To be clear to anyone lurking, the fix has been merged but not yet released on PyPI.
waitress 1.1.0 has been released on PyPI, and it includes this fix.
Hi.
I have waitress installed on my production server and it generates strange exceptions. Like this:
I found that these exceptions generated when some stupid bot sends request with raw bytes \xd0 in http header in first line. Here is a line from nginx log (nginx proxy queries to waitress):
As you can see, here the client sent both urlescaped and raw bytes in GET. According to RFC, url must by escaped. But nginx doesn't care.
I also wrote simple POC to demonstrate the issue:
I think Waitress should be able to handle this exception. It will be better just send 400 Bad Request to the client. Take a look at the rfc - http://tools.ietf.org/html/rfc2616#section-5.1.2