summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver/matcher_test.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-12-04 19:12:13 -0500
committerGitHub <noreply@github.com>2020-12-04 17:12:13 -0700
commit6e9ac248dd5c2f7a4cd4e37ff277a86c18085be6 (patch)
treea6c9da30da87e8cba6986f43c6483dadf4919e6f /modules/caddyhttp/fileserver/matcher_test.go
parent5643dc3fb9e84b1dc862aa96bc5474d06f36d9c4 (diff)
fastcgi: Set PATH_INFO to file matcher remainder as fallback (#3739)
* fastcgi: Set PATH_INFO to file matcher remainder as fallback * fastcgi: Avoid changing scriptName when not necessary * Stylistic tweaks Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
Diffstat (limited to 'modules/caddyhttp/fileserver/matcher_test.go')
-rw-r--r--modules/caddyhttp/fileserver/matcher_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/caddyhttp/fileserver/matcher_test.go b/modules/caddyhttp/fileserver/matcher_test.go
index ddd4f78..e319907 100644
--- a/modules/caddyhttp/fileserver/matcher_test.go
+++ b/modules/caddyhttp/fileserver/matcher_test.go
@@ -206,9 +206,13 @@ func TestPHPFileMatcher(t *testing.T) {
func TestFirstSplit(t *testing.T) {
m := MatchFile{SplitPath: []string{".php"}}
- actual := m.firstSplit("index.PHP/somewhere")
+ actual, remainder := m.firstSplit("index.PHP/somewhere")
expected := "index.PHP"
+ expectedRemainder := "/somewhere"
if actual != expected {
- t.Errorf("Expected %s but got %s", expected, actual)
+ t.Errorf("Expected split %s but got %s", expected, actual)
+ }
+ if remainder != expectedRemainder {
+ t.Errorf("Expected remainder %s but got %s", expectedRemainder, remainder)
}
}