From 4e9ad50f6503a347e85b7030afa616a83f145394 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 4 Jan 2023 11:07:27 -0700 Subject: fileserver: Add a couple test cases With placeholders --- modules/caddyhttp/fileserver/matcher_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/caddyhttp/fileserver') diff --git a/modules/caddyhttp/fileserver/matcher_test.go b/modules/caddyhttp/fileserver/matcher_test.go index 0f8c6bb..6ef86b7 100644 --- a/modules/caddyhttp/fileserver/matcher_test.go +++ b/modules/caddyhttp/fileserver/matcher_test.go @@ -62,6 +62,12 @@ func TestFileMatcher(t *testing.T) { expectedType: "file", matched: true, }, + { + path: "/foo.txt?a=b", + expectedPath: "/foo.txt", + expectedType: "file", + matched: true, + }, { path: "/foodir", expectedPath: "/foodir/", @@ -211,6 +217,12 @@ func TestPHPFileMatcher(t *testing.T) { expectedType: "file", matched: false, }, + { + path: "/index.php?path={path}&{query}", + expectedPath: "/index.php", + expectedType: "file", + matched: true, + }, } { m := &MatchFile{ fileSystem: osFS{}, -- cgit v1.2.3