summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/staticfiles
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-05-20 15:46:47 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-05-20 15:46:52 -0600
commitd22f64e6d41117c242fc4ecd00179e68b8f118c5 (patch)
treede059f4423337b6d58c6322c110eb6e928f1080e /modules/caddyhttp/staticfiles
parent22995e5655b3d5117743d98bf5c7ba8ed335a2c5 (diff)
Implement headers middleware
Diffstat (limited to 'modules/caddyhttp/staticfiles')
-rw-r--r--modules/caddyhttp/staticfiles/matcher.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/caddyhttp/staticfiles/matcher.go b/modules/caddyhttp/staticfiles/matcher.go
index cccf54b..9ce3f4c 100644
--- a/modules/caddyhttp/staticfiles/matcher.go
+++ b/modules/caddyhttp/staticfiles/matcher.go
@@ -16,6 +16,8 @@ func init() {
})
}
+// FileMatcher is a matcher that can match requests
+// based on the local file system.
// TODO: Not sure how to do this well; we'd need the ability to
// hide files, etc...
// TODO: Also consider a feature to match directory that
@@ -29,6 +31,7 @@ type FileMatcher struct {
Flags []string `json:"flags"`
}
+// Match matches the request r against m.
func (m FileMatcher) Match(r *http.Request) bool {
// TODO: sanitize path
fullPath := filepath.Join(m.Root, m.Path)