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 Fri, 18 Mar 2011 10:36:27 +0100, Florian Friesdorf <[email protected]> wrote:
> 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?

Please ignore this post - mail client played tricks on me and I did not
see your further postings before writing this.

> > 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
Non-text part: application/pgp-signature

-- 
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)

iQIcBAEBAgAGBQJNgyjsAAoJEDj4maMMRfCDk30QAJ7NR0nYpF5uGhUB1RCYJffp
2E72fIQ8Pd0H3WZMdr7bHFUbNi9NF/7rA155O0pM/sPQw0crl9Jn08EXo0SDlJLv
Za0xL89c8V3rHvx0dZ00pse249EP5CySH4VTgvSfzNNYHZcbDeBw8Py5tsVP69nL
YBgDAKaZSRunx0iIiD6F1LV0xqf5UJUh2DC/PPOIKroVVL7GcdBQBFLXdzcJcKwi
AWeZDStSavBQ6xJQcG5nuE6Web6e40O8/XtcTCi/wMI/H1dXqWa/qAQK+4S7LUtO
7/rx4MYS8eufHQOx4KnjMxyGS5IRT8K6Jxa30vHQQ4qilk/OoxI+S5WIVV293Gmo
jCuEKqiZfycxAvZFKa0+WUDcy+jHwagzC4HrW92n5/ukCZYnJB3fiKaGQciCglR3
7FYxIFBrUQJoozqD2+KV2IsDd/evEBIGrfpKuK5rs3e8aS+XqSGHwU8NIW/jGG3I
uB2kacZP2vdIfc0Xb1MYzwlxFI8BjttfjYQs8QvYF8gknMIF03Dyj5+mOee70qwZ
HUXyCoHStMtt6NCxyvaszZRYr1QI96T77rZ+ghJEwMkdJ/TPbRB+qFlySBOuDhTQ
2uUv/tVj+E3OhtZ/kFGa0hVCSrIct5r2T0F/AvDVKETxoyQQl4krCcFANGDZiUFT
R7VRypPvZKYDiq/vd2ki
=Vzeq
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.