Skip to content

Don't 500 when PATH_INFO is not valid utf-8 - #500

Open
gyanu2507 wants to merge 1 commit into
Pylons:mainfrom
gyanu2507:encget-invalid-utf8
Open

Don't 500 when PATH_INFO is not valid utf-8#500
gyanu2507 wants to merge 1 commit into
Pylons:mainfrom
gyanu2507:encget-invalid-utf8

Conversation

@gyanu2507

Copy link
Copy Markdown

encget re-decodes latin-1 PATH_INFO as url_encoding (utf-8). A request for /%c0 is valid WSGI and a common scanner probe; it is not valid utf-8, so request.path / request.url raised UnicodeDecodeError.

If that decode fails, keep the latin-1 value.

Fixes #464

WSGI gives latin-1. A request for /%c0 is a probe, not a reason
to UnicodeDecodeError out of encget.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encoding issue in request.py

1 participant