urllib.unquote in paste.httpserver prevents slashes in path segments
Florian Friesdorf <[email protected]>
| Newsgroups | gmane.comp.python.web |
|---|---|
| Message-ID | <[email protected]> |
I think paste.httpserver.WSGIHandlerMixin.wsgi_setup should not urllib.unquote the path [1] before setting it in the wsgi environment [2]. The only pre-processing performed on the path between [1] and [2] is concerned with slashes '/'. By urllib.unquoting it is not possible to have urllib.quoted slashes within one path segment. At least pyramid without routing fully relies on ``environ['PATH_INFO']`` [3]; by commenting [1] I succeeded to have slashes in path segments, they are handle by pyramid in [4]f. However, webob.request.BaseRequest would need to be adjusted wherever PATH_INFO from the environment is used (e.g [5]). Reasoning: The path stored in environ['PATH_INFO'] is still a path, therefore it must not be urllib.unquoted, the unquoting must happen after the path is split up in segments ([4]). [1] https://bitbucket.org/ianb/paste/src/4f5cfde87603/paste/httpserver.py#cl-180 [2] https://bitbucket.org/ianb/paste/src/4f5cfde87603/paste/httpserver.py#cl-217 [3] https://github.com/Pylons/pyramid/blob/master/pyramid/traversal.py#L594 [4] https://github.com/Pylons/pyramid/blob/master/pyramid/traversal.py#L495 [5] https://bitbucket.org/ianb/webob/src/c0bb5309cfca/webob/request.py#cl-265 -- Florian Friesdorf <[email protected]> GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: [email protected] IRC: chaoflow on freenode,ircnet,blafasel,OFTC _______________________________________________ Web-SIG mailing list [email protected] Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org
signature.asc
(application/pgp-signature, 835 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJNgk6OAAoJEDj4maMMRfCD23EP/iqe8D35xkmOGkZV0cMheW+7 9XsjlwqyM/D6FGH5Na6CwwVMVQ9GSwtE22vmuVr5+oEoXGIIrBQodwMm4tGxe/cM jsOZ24+6NsTLw2aIh63oNQaijyN5CeNnpn/yNgxr620U5qFVkjxF8GdCZ1ax89tR RNqtTpoDZjDjtfNHVEOtDGxRCEHxrnSqbLHHqGXiBdxMY5d9nuhQQNYmpCmZq2a4 TRwyTMkwu2tLa5yRH2x/mEC2V2T5ZNqYy1m7OnKATUtbPZQAZNZBAynccJvixK1I eIF0AETzE4HM5Fu8DFWZxacnCeO0ZB8N+i7P2Ysarw2uz9HI7uTrnOYlaUqq/qud NFHjqDjyiD/Jm1U4doLd0GW8Oc05bbvIvmXS6cQW8PTvaN7sYW9kdVxfQM8m5UoS hM4FFrQBo8JWHMNlfbDtTcpuFT3ma2qlfs90ztbly8gvLgittuyv5pewb/E/K+UN gzJM84mX0KZr92Mzs7chTh1GJLSudthC/1WnSd7ci7UkWFTIahTpDC7OPNUUvoad yf/hsOs6LPXEgkOooknQG3TkAjs/p6U3tCcrAu6fOWkWyh/0kX7b+GgY+YruIKGF T8FSw0J5hVL153546CntlQsMnVq7b0VTQBm+4sJPTd53ydLwM1sy2a8Ttty4kOfx NVWM03KPl1wZeJhB5+EX =Vhbu -----END PGP SIGNATURE-----