summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2023-01-04 11:07:27 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2023-01-04 11:07:27 -0700
commit4e9ad50f6503a347e85b7030afa616a83f145394 (patch)
tree4c62f3a073ee447e2a1fbd19280852b97ebe31cd /modules
parent05a4637489d669c274dddf7e8dd23735ef149302 (diff)
fileserver: Add a couple test cases
With placeholders
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/fileserver/matcher_test.go12
1 files changed, 12 insertions, 0 deletions
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
@@ -63,6 +63,12 @@ func TestFileMatcher(t *testing.T) {
matched: true,
},
{
+ path: "/foo.txt?a=b",
+ expectedPath: "/foo.txt",
+ expectedType: "file",
+ matched: true,
+ },
+ {
path: "/foodir",
expectedPath: "/foodir/",
expectedType: "directory",
@@ -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{},