aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/caddyhttp_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/caddyhttp_test.go')
-rw-r--r--modules/caddyhttp/caddyhttp_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/caddyhttp/caddyhttp_test.go b/modules/caddyhttp/caddyhttp_test.go
index 84c0271f1..8c55fcb7a 100644
--- a/modules/caddyhttp/caddyhttp_test.go
+++ b/modules/caddyhttp/caddyhttp_test.go
@@ -63,7 +63,7 @@ func TestSanitizedPathJoin(t *testing.T) {
{
inputRoot: "/a/b",
inputPath: "/%2e%2e%2f%2e%2e%2f",
- expect: filepath.Join("/", "a", "b") + separator,
+ expect: filepath.Join("/", "a", "b"),
},
{
inputRoot: "/a/b",
@@ -85,6 +85,12 @@ func TestSanitizedPathJoin(t *testing.T) {
inputPath: "/D:\\foo\\bar",
expect: filepath.Join("C:\\www", "D:\\foo\\bar"),
},
+ {
+ // https://github.com/golang/go/issues/56336#issuecomment-1416214885
+ inputRoot: "root",
+ inputPath: "/a/b/../../c",
+ expect: filepath.Join("root", "c"),
+ },
} {
// we don't *need* to use an actual parsed URL, but it
// adds some authenticity to the tests since real-world