Skip to content

Commit

Permalink
caddyhttp: Test cases for %2F and %252F (#6084)
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Feb 7, 2024
1 parent bc1e631 commit bde4621
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/caddyhttp/caddyhttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ func TestSanitizedPathJoin(t *testing.T) {
inputPath: "/%2e%2e%2f%2e%2e%2f",
expect: filepath.Join("/", "a", "b") + separator,
},
{
inputRoot: "/a/b",
inputPath: "/foo%2fbar",
expect: filepath.Join("/", "a", "b", "foo", "bar"),
},
{
inputRoot: "/a/b",
inputPath: "/foo%252fbar",
expect: filepath.Join("/", "a", "b", "foo%2fbar"),
},
{
inputRoot: "C:\\www",
inputPath: "/foo/bar",
Expand Down

0 comments on commit bde4621

Please sign in to comment.