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:
Francis Lavoie
2020-09-16 20:09:28 -04:00
committed by GitHub
parent b01bb275b3
commit b95b87381a
6 changed files with 165 additions and 35 deletions

View File

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