Skip to content Skip to sidebar Skip to footer

Pyramid Replacing Double Forward-slash In Url Matchdict

Essentially, I'm just building an API redirection route inside of Pyramid to process cross-domain AJAX requests without using JSONP. I've added a route, like so: config.add_route('

Solution 1:

This is a fundamental limitation of any WSGI-based application. URLs are urldecoded and slashes are compacted before the URL is passed to the WSGI app. If you want to preserve the slashes you will need to urlencode them twice. AFAIK there is no way around this using a query string.

I guess I should point out that the original URL is available, but from it you will have to parse out the part you care about yourself. It is in request.url. request.path_info is what Pyramid and most WSGI apps use to dispatch URLs because it contains only the sub-path that is relative to where the app is mounted.

Post a Comment for "Pyramid Replacing Double Forward-slash In Url Matchdict"