Hi all,
I'm not sure if this would be considered a bug, but I'm having trouble
generating URLs using request.route_url, when my replacement values
themselves contain slashes. For example, if I had the following route
defined:
config.add_route('test', '/tests/{testname}/')
and I generate a route like this:
request.route_url('test', testname='one/two')
...the resulting URL will look something like:
http://localhost/tests/one%2Ftwo/
However, if I try to visit this URL, it is treated exactly the same as:
http://localhost/tests/one/two/
...so the route doesn't match. I suspect that as far as HTTP is concerned
those 2 URLs are equivalent, so my workaround will have to be escaping my
replacement values before creating URLs, and unescaping them in my views.
Could this be considered a bug in route_url, that it generates URLs that
don't roundtrip correctly? And could it be fixed by adding special handling
of the "/" character in the generator and the matcher?
Thanks,
Simon
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.