Chris Shenton wrote:
> I've got a route defined in routing.py like:
> 
>   m.connect('kb/:fac/:sev/:expires/:checksum/*text', controller='kb', 
> action='search')
> 
> In a command line tool, I import routes and routing to get the map
> then use generate to construct a URL:
> 
>   kb_url = conf.URL_BASE + m.generate('kb','search',
>                                       fac=facility, sev=severity, 
> expires=expire,
>                                       checksum=checksum, text=message)
> 
> This matches, most of the time, and most special characters are URL
> encoded.  But if one of the generate() parameters contains slashes,
> the slashes aren't encoded; below, facility="FastEnet-10/100/e0a" and
> severity="error": 
> 
>   
> http://example.com/kb/FastEnet-10/100/e0a/error/42/666/duplicate+IP+address+192.168.1.98%21%21+sent+from+ethernet+address%3A+00%3Aa0%3A98%3A00%3A78%3A3d
> 
> The slashes in the URL cause the route match to fail.
> 
> Is this a bug in the URL encoding that routes is doing?
> 
> If not, how should I encode them so that subsequent routes encoding
> doesn't break decoding by apache and pylons-routes?

FWIW, there will be no way for Routes to distinguish an incoming request 
for FastEnet-10/100 from FastEnet-10%2f100 -- WSGI/CGI dictates that the 
path is decoded before it is sent to Routes, so the two end up the same.

Generally it seems like Routes should just reject such a substitution.

-- 
Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org

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