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

Robert Brewer fumanchu at aminus.org
Sat Jan 19 04:07:36 CET 2008


Ben Bangert wrote:
> I unfortunately couldn't find anything in the WSGI spec to indicate
> whether or not I could expect environ variables relating to the URL to
> be URL decoded when I get them or whether they reflect the raw URL
> that was sent to the browser.
> 
> 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.
> Sure enough, Paste was doing URL un-quoting, then Routes, and the
> double URL un-quote resulted in the + being a space.
> 
> Is there some definitive word on whether a WSGI application should
> expect to have it URL un-quoted or not?

The last time I asked that question here [1], Phillip kindly pointed out
to me that that's defined by the CGI spec. I could go through the agony
of distributed English-obfuscated BNF analysis again, but I'll just note
that I changed CP's wsgiserver to do decoding that very day. So I think
the answer is "yes".


Robert Brewer
fumanchu at aminus.org

[1] http://mail.python.org/pipermail/web-sig/2006-August/002230.html



More information about the Web-SIG mailing list