On Thu, Apr 3, 2008 at 12:07 AM, michi <[EMAIL PROTECTED]> wrote:
>
>  Ok, just one more thing...
>
>  One consequence of Paste doing percent-decoding is that the id cannot
>  contain forward-slashes. Here is an example url:
>
>  http://example.com/topic/view/PL%2FSQL
>
>  In this case request.environ["PATH_INFO"] is /topic/view/PL/SQL, and
>  there is no way for routes to tell if there was an escaped slash. The
>  WSGI spec doesn't seem to specify whether the value of PATH_INFO
>  should be percent-decoded or not. What's the expected behavior here?

If your ID can include a slash, you should be using a wildcard variable:

    m.connect("/:topic/view/*id", controller="foo", action="bar")

You can try ":controller/:action/*id", but no guarantees on what wrong
URLs it may swallow.

As for whether Paste should defer unescaping, here's what the RFCs say:

    ftp://ftp.isi.edu/in-notes/rfc2616.txt  (HTTP, section 3.2.3)

    http://www.faqs.org/rfcs/rfc2396.html (URI, sections 2,2, 2,3,
2,4, 2,4,1, 2.4.2)

The slash is a reserved character, meaning it's distinct from its
escaped equivalent (%2F).  As opposed to tilde which is unreserved, so
"~" and "%7E" are completely equivalent.

However, I'm sure Paste would find it very tedious to unescape some
characters but not others.  There's also the issue of filenames with
spaces.  When should "a%20space.jpg" be unescaped to "a space.jpg"?

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to