From bde46211e311e1e9009e8c5160ead08f6baf1c02 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 7 Feb 2024 05:13:17 -0500 Subject: [PATCH] caddyhttp: Test cases for `%2F` and `%252F` (#6084) --- modules/caddyhttp/caddyhttp_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/caddyhttp/caddyhttp_test.go b/modules/caddyhttp/caddyhttp_test.go index a14de7814..84c0271f1 100644 --- a/modules/caddyhttp/caddyhttp_test.go +++ b/modules/caddyhttp/caddyhttp_test.go @@ -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",