etianen / aiohttp-wsgi

WSGI adapter for aiohttp.
https://aiohttp-wsgi.readthedocs.io
BSD 3-Clause "New" or "Revised" License
232 stars 20 forks source link

Improper "unquoting" #5

Closed jcea closed 8 years ago

jcea commented 8 years ago

I am requesting this URL to my WSGI application: "http://127.0.0.1:8080/buffy/Test%20%C3%A1%20%C3%B3".

What I am getting in PATH_INFO is: "/buffy/Test á ó". This have two problems:

  1. The string is "unquoted". I would expect to get it "as" I send it. That is what other WSGI servers do.
  2. The unquoted is literal, not doing the right utf-8 translation. The right unquoting would be "/buffy/Test á ó".
etianen commented 8 years ago

Thanks for reporting this. It should be fixed in master. Please take a look and let me know if it works for you.

Incidentally, the latest master branch requires Python 3.4.4 onwards to run. Python 3.3 support has now been dropped, and the minimum aiohttp version is 0.19.0. Dropping of Python 3.3 was necessary to support breaking API changes in aiohttp.

etianen commented 8 years ago

Huh, turns out that unquoting the strings using latin1 encoding is the correct approach. The wsgiref reference server does just this.

screen shot 2016-08-02 at 14 10 21

I'm reverting a741614