summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver/matcher_test.go
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2020-08-01 12:43:30 -0600
committerGitHub <noreply@github.com>2020-08-01 12:43:30 -0600
commitc054a818a1d6fee61cebc48b4286bb40d0553f4c (patch)
tree86a042e120cac082d0eedee0c8123a2cadf92ec1 /modules/caddyhttp/fileserver/matcher_test.go
parentaf5c148ed1d8e405978b71e7efe15d0a829cab50 (diff)
fileserver: Fix newly-introduced failing test on Linux (#3625)
* fileserver: First attempt to fix failing test on Linux I think I updated the wrong test case before * Make new test function I guess what we really are trying to test is the case insensitivity of firstSplit. So a new test function is better for that.
Diffstat (limited to 'modules/caddyhttp/fileserver/matcher_test.go')
-rw-r--r--modules/caddyhttp/fileserver/matcher_test.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/caddyhttp/fileserver/matcher_test.go b/modules/caddyhttp/fileserver/matcher_test.go
index e3f2911..51cd284 100644
--- a/modules/caddyhttp/fileserver/matcher_test.go
+++ b/modules/caddyhttp/fileserver/matcher_test.go
@@ -72,11 +72,6 @@ func TestPHPFileMatcher(t *testing.T) {
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",
expectedPath: "/%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)
+ }
+}