A path holding a character Go escapes reaches the app as the client sent it (closes #126)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
ReverseProxy sends the path URL.EscapedPath gives, which decodes and escapes again a path holding a character such as |, turning %2F into /. The path as sent now goes in URL.Opaque, which Go sends as it is; the rate limit and WAF exempt paths and the log line's path use the same path. A path starting with // is left as before: Go would send it in Opaque as a scheme and host. Model: opus-5-5
This commit was merged in pull request #149.
This commit is contained in:
@@ -185,6 +185,9 @@ func TestRateLimitCountsPathsThatAreNotExempt(t *testing.T) {
|
||||
"/assets/x%2Fy",
|
||||
"/assets/x%2fy",
|
||||
`/assets/x\y`,
|
||||
// The same with a character Go escapes, |, for which Go's
|
||||
// URL.EscapedPath gives /assets/x/y%7Cz, with no encoded slash.
|
||||
"/assets/x%2Fy|z",
|
||||
} {
|
||||
t.Run(sent, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
Reference in New Issue
Block a user