mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-28 22:55:50 +08:00
replacer: Fix escaped closing braces (#5995)
This commit is contained in:
@ -479,3 +479,20 @@ func TestValidPrefix(t *testing.T) {
|
||||
caddytest.AssertAdapt(t, successCase.rawConfig, "caddyfile", successCase.expectedResponse)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUriReplace(t *testing.T) {
|
||||
tester := caddytest.NewTester(t)
|
||||
|
||||
tester.InitServer(`
|
||||
{
|
||||
admin localhost:2999
|
||||
http_port 9080
|
||||
}
|
||||
:9080
|
||||
uri replace "\}" %7D
|
||||
uri replace "\{" %7B
|
||||
|
||||
respond "{query}"`, "caddyfile")
|
||||
|
||||
tester.AssertGetResponse("http://localhost:9080/endpoint?test={%20content%20}", 200, "test=%7B%20content%20%7D")
|
||||
}
|
||||
|
Reference in New Issue
Block a user