mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-04 19:24:42 +08:00
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
This commit is contained in:
@ -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",
|
||||
|
Reference in New Issue
Block a user