Open chrisroy87 opened 2 years ago
I don't understand why you'd mangle the input anyway. Just require that users enter the full correct URL - maybe they've put it behind a reverse proxy and the path is not /ari
, it's not sensible to overwrite the URL path.
If you really did want to mangle the URL, and there was some very good reason for that, using net/url
would be a much more robust way of doing it, rather than using regexp.
The regex manipulation of BasePath at:
is wrong. It replaces the entire base path with just "/ari".