Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving the url anchor in a werkzeug request

I have a DAV protocol that stores out-of-band data in the url anchor, e.g. the ghi in DELETE /abc.def#ghi. The server is a Flask application.

I can see the request come in on the wire via tcpdump, but when I look at the werkzeug Request object (such as url() or base_url()), all I get back is /abc.def. The #ghi has been stripped out.

Is there a method that returns this information, or do I have to subclass Request to handle this myself? If so, is there an example I can use as an inspiration?

like image 772
dland Avatar asked Sep 29 '11 12:09

dland


1 Answers

From Wikipedia (Fragment Identifier) (don't have the time to find it in the RFC):

The fragment identifier functions differently than the rest of the URI: namely, its processing is exclusively client-side with no participation from the server

So Flask - or any other framework - doesn't have access to #ghi.

like image 95
Zoran Zaric Avatar answered Nov 09 '22 02:11

Zoran Zaric