I am re-implementing a legacy system as a Flask app and must keep url patterns as they are. One of the urls includes a user's full email address directly (in other words, the email address is part of the url and not as a GET parameter).
When I send requests to this url, Flask automatically responds with a redirect to the same url except that the '@' sign in the email address is replaced with '%40'. For example, a request to /users/new/user@example.com/
is redirected to /users/new/user%40example.com/
. I even receive this response from Flask when I send up POST requests directly to the second url, so I'm assuming that the '%40' is automatically translated into an '@' character when processed for the request.
How do I get Flask to accept requests to urls that include the '@' sign without redirecting? This may be Werkzeug's fault, as Flask's URL resolving system is built on Werkzeug.
EDIT: I Incorrectly included a trailing slash in the initial request URL listed in this question. My problem was in fact caused by the absence of the slash, not the replacement of '@' with '%40'.