diff --git a/modules/caddyhttp/fileserver/matcher_test.go b/modules/caddyhttp/fileserver/matcher_test.go index e3f291164d5..51cd284e85d 100644 --- a/modules/caddyhttp/fileserver/matcher_test.go +++ b/modules/caddyhttp/fileserver/matcher_test.go @@ -71,11 +71,6 @@ func TestPHPFileMatcher(t *testing.T) { expectedPath: "/foo.php.php/index.php", matched: true, }, - { - path: "/foo.php.PHP/index.php", - expectedPath: "/foo.php.PHP/index.php", - matched: true, - }, { // See https://github.com/caddyserver/caddy/issues/3623 path: "/%E2%C3", @@ -115,3 +110,12 @@ func TestPHPFileMatcher(t *testing.T) { } } } + +func TestFirstSplit(t *testing.T) { + m := MatchFile{SplitPath: []string{".php"}} + actual := m.firstSplit("index.PHP/somewhere") + expected := "index.PHP" + if actual != expected { + t.Errorf("Expected %s but got %s", expected, actual) + } +}