From 6e9ac248dd5c2f7a4cd4e37ff277a86c18085be6 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Fri, 4 Dec 2020 19:12:13 -0500 Subject: 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 --- modules/caddyhttp/fileserver/matcher_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/caddyhttp/fileserver/matcher_test.go') 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) } } -- cgit v1.2.3