net/http: builtin slash-suffix redirect does not persist the raw (encoded) url #70758
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.22.6 linux/amd64
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/dw5wFNBPzix (go 1.23, sometimes the playground time outs, just rerun it)
The default/builtin slash-suffix redirector does not persist the raw url, specifically a url encoded url.
What did you see happen?
Got:
/api/resource%2fsubdir/info
returns<a href="/api/resource/subdir/info/">Moved Permanently</a>.
Returns a url which is invalid, and does not match the original path.
What did you expect to see?
Expected:
/api/resource%2fsubdir/info
should return<a href="/api/resource%2fsubdir/info/">Moved Permanently</a>.
Which persists the url encoded url.
The text was updated successfully, but these errors were encountered: