>> I'm having a problem with encoded forward slashes in a URL. That is,
>> I need to pass an 'id' that has encoded forward slashes in its name,
>> but this results in routes not being be able map the URL: apparently
>> it sees another subset of paths in the URL, even with the slashes
>> encoded as %2F.
>>
>> As an example, this is the actual URL called:
>>
>>    http://127.0.0.1:5000/finder/select/R%2F2007%2F23
>
> Unfortunately in WSGI the path is decoded, which means that %2f and /
> look exactly the same to Routes.  So there's not really a good way to
> resolve this.  I would recommend normalizing your IDs so that /  
> doesn't
> appear in them.
>
>    Ian

I was afraid so. I guess somewhere along the line, things have to be  
decoded anyway.
I have little say over the ID, so I cannot really prevent a slash or % 
2f occurring (or simply tell how many there'll be).
For the moment, I took Ron's idea and use map.connect 
(':controller/:action/*id'), but I guess that may prevent some Routes  
functionality (eg like an automatic 404).
Funny thing is, with this solution, when I actually use encoded  
slashes for such a URL, as the example above, I get a 404. When I use  
a proper forward slash (/finder/select/R/2007/23), I get the correct  
response. Rather unexpected; I guess I'll have to dig more into what  
happens along the way.

Cheers,

   Evert




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