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("api","/api/{url:.*}")
with which I want to capture URLs like so:
http://domain.com/api/http://location.of/other/api
However, when grabbing the captured URL suffix out of the Request matchdict, I get the following:
http:/location.of/other/api
I'm guessing some escaping has been done during URL processing/matching? How can I avoid this, and get the desired URL with two forward slashes?
Even if I pass the URL in as a GET parameter, the issue remains. Perhaps it's something to do with the way Pyramid's multidicts work?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…