mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 15:53:17 +00:00
replacer: Fix escaped closing braces (#5995)
This commit is contained in:
parent
c839a98ff5
commit
80acf1bf23
4 changed files with 70 additions and 2 deletions
|
@ -69,7 +69,7 @@ func TestReplacer(t *testing.T) {
|
|||
},
|
||||
{
|
||||
input: `\}`,
|
||||
expect: `\}`,
|
||||
expect: `}`,
|
||||
},
|
||||
{
|
||||
input: "{}",
|
||||
|
@ -164,6 +164,10 @@ func TestReplacer(t *testing.T) {
|
|||
input: string([]byte{0x26, 0x00, 0x83, 0x7B, 0x84, 0x07, 0x5C, 0x7D, 0x84}),
|
||||
expect: string([]byte{0x26, 0x00, 0x83, 0x7B, 0x84, 0x07, 0x7D, 0x84}),
|
||||
},
|
||||
{
|
||||
input: `\\}`,
|
||||
expect: `\}`,
|
||||
},
|
||||
} {
|
||||
actual := rep.ReplaceAll(tc.input, tc.empty)
|
||||
if actual != tc.expect {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue