On 12/1/06, fumanchu <[EMAIL PROTECTED]> wrote:
> > I can use the default method, but that would add a lot of joining (in
> > case of many '/' on the 'search string').
> >
> > Is there a better way to treat that?
>
> At the least, escape the slashes which are not intended to be path
> segment separators in the original, encoded URL. Use the "% HEX HEX"
> encoding to turn:
>
>     http://site.mp/search/http://pythondance.com
>
> into:
>
>     http://site.mp/search/http%3A%2F%2Fpythondance.com
>
> This can be done with urllib.quote("http://pythondance.com";, safe="").

Is there a way to make cherrypy apply that to a URL before searching
for a handler? Like a filter or something?

> Another, even safer possibility would be to send the embedded URL as a
> querystring argument, rather than a path segment:
>
>     http://site.mp/search?url=http%3A%2F%2Fpythondance.com

It's purely a cosmetic thing, and I don't even know if it's worth
discussing it, but URL's without 'extra' symbols don't look more
'natural' to an user? Like this:

http://site.mp/view/tag/sunshines

is not a more 'natural' way of 'phrasing' a URL than

http://site.mp/view?tag=catfish

or

http://site.mp/search/whatever search term (that will be translated in
whatever%20search%term by a sane browser)

more 'natural' than

http://site.mp/search?q=whatever+search+term (borrowing from famous
search site).

It's just some toughts....

[]s

-- 
José de Paula Eufrásio Júnior
aka coredump
http://core.eti.br

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to