[Flask] Flask path route variable with a dot between two forward slashes

Francisco Roque francisco at roque.com.pt
Tue Nov 24 09:06:04 EST 2015


Hi all,

I am trying to capture an url from a flask request. All works fine except
when the url has a dot in between two forward slashes, for example:
http://met.no/Nyheter/./Fase+C:+Ekstremværet+Petra+pågår.b7C_xdrSX6.ips
<http://met.no/Nyheter/./Fase+C:+Ekstremv%C3%A6ret+Petra+p%C3%A5g%C3%A5r.b7C_xdrSX6.ips>

The route used is below:

@app.route('/url/<path:url>', methods=['GET'])
def get_url(url):
    return url

I understand flask is somehow resolving relative urls and ./ might mean the
current directory, but how can I make it so the url is taken as is?

Best,
Francisco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20151124/93e1588c/attachment.html>


More information about the Flask mailing list