[Web-SIG] URL quoting in WSGI (or the lack therof)

Luis Bruno lbruno at 100blossoms.com
Sat Jan 19 15:38:09 CET 2008

Hello y'all, delurking,

I'm using a /-delimited path, %-encoding each literal '/' appearing in 
the path segments. I was not amused to see egg:Paste#http urldecoding 
the whole PATH_INFO.

Ben Bangert wrote:
> This recently became an issue, when a user noticed that the %2B URL 
> encoding for a + sign, had turned into a space when it hit their app.
A swift monkey-patch to 
paste.httpserver.py:WSGIHandlerMixin.wsgi_setup() later, and 
ORIGINAL_PATH_INFO is part of the WSGI spec in my world. The following 
URL now Does The Right Thing:

Rober Brewer wrote:
> I changed CP's wsgiserver to do decoding that very day. So I think the 
> answer is "yes".
IMHO "yes" is the wrong answer; I am also very unsure about what is the 
right answer. I have to walk [urldecode(segment) for segment in 
ORIGINAL_PATH_INFO.split('/')]; this doesn't look like the Right Answer 
to me anyway.

Luís Bruno

More information about the Web-SIG mailing list