From b95b87381a282e1fe57295d145b71645d7801f07 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 16 Sep 2020 20:09:28 -0400 Subject: fileserver: Fix try_files for directories; windows fix (#3684) * fileserver: Fix try_files for directories, windows fix * fileserver: Add new file type placeholder, refactoring, tests * fileserver: Review cleanup * fileserver: Flip the return args order --- modules/caddyhttp/fileserver/staticfiles_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/caddyhttp/fileserver/staticfiles_test.go') diff --git a/modules/caddyhttp/fileserver/staticfiles_test.go b/modules/caddyhttp/fileserver/staticfiles_test.go index c47fbd1..1bbd77b 100644 --- a/modules/caddyhttp/fileserver/staticfiles_test.go +++ b/modules/caddyhttp/fileserver/staticfiles_test.go @@ -42,6 +42,10 @@ func TestSanitizedPathJoin(t *testing.T) { inputPath: "/foo", expect: "foo", }, + { + inputPath: "/foo/", + expect: "foo" + string(filepath.Separator), + }, { inputPath: "/foo/bar", expect: filepath.Join("foo", "bar"), @@ -73,7 +77,7 @@ func TestSanitizedPathJoin(t *testing.T) { { inputRoot: "/a/b", inputPath: "/%2e%2e%2f%2e%2e%2f", - expect: filepath.Join("/", "a", "b"), + expect: filepath.Join("/", "a", "b") + string(filepath.Separator), }, { inputRoot: "C:\\www", -- cgit v1.2.3