Re: urllib.unquote in paste.httpserver prevents slashes in path segments
Florian Friesdorf <[email protected]>
| Newsgroups | gmane.comp.python.web |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 17 Mar 2011 15:10:56 -0500, Ian Bicking <[email protected]> wrote: > It's implied by WSGI itself that the path be unquoted; there's no fix short > of changing the specification. What is WSGI's solution for path segments containing slashes? > On Thu, Mar 17, 2011 at 1:10 PM, Florian Friesdorf <[email protected]> wrote: > > > > > 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/ianb%40colorstudy.com > > > > Non-text part: text/html -- 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) iQIcBAEBAgAGBQJNgyebAAoJEDj4maMMRfCD4ncP/3IspfZSw2pmEcneOy+mqiOZ +hKFiG056b0rap/u5FRrG8h7VjsQ7CUxnVca/NC6yNbnCjKjce5pTJ0sVeeHfq+w w73om5vh2Y4hIs7aJUChxKW+ljIejSdluWetPYLTvsdSNUjNnmPX0F8X+rT8m4ay 9syct4ty90TxzNYKBu+S2mrxtuT3HnDkOW9YXmgSpRovmHKtJKdSqJdMnm0ITy9W Js001fMOucznYrh9FgucFmfh3q3NC+XrTto1pq9p0W40eZBippgBWjHtOYfwGwg9 mlVfsF2vAorYISvb4Cvm7IC7mMqj7RZcU28PKmgDpjtuw8sUuYsQ3wpoYIt2x64b qGO8aIb3WFb/U/O6azC23kLNu0xZao+Sn1SlrF9iOhSEk4nvySo+QROPlOhoEMAk wUVtHGr3+Phf69zqoBQepJyyAPizij0+KIluifpIhkhnqnGySEzohNCbZAL26s8F ixT3rKSl8GpOA2/i0/mO+cqrUl1uhkCkg/VP42qJglCEdRBOhPNZDPDRGDXXDef7 Ec+VMxKm1iSm6N7zrMyCymQcsO2yyc/kyfB5I9L/pprnrYahpypMG32UrT/yNcec qX9XQ1r1fdOSARB0Tdynn91pxZJ6eLQF2vBOnAeqcaROzpkGjXdtpEih5CNzVOX4 mypjiFHrmGDO2abeSvg6 =+LK8 -----END PGP SIGNATURE-----