caddyhttp: Test cases for %2F and %252F (#6084)

This commit is contained in:
Francis Lavoie 2024-02-07 05:13:17 -05:00 committed by GitHub
parent bc1e63198d
commit bde46211e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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",