1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

fileserver: Add a couple test cases

With placeholders
This commit is contained in:
Matthew Holt 2023-01-04 11:07:27 -07:00
parent 05a4637489
commit 4e9ad50f65
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -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{},