From d22f64e6d41117c242fc4ecd00179e68b8f118c5 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 20 May 2019 15:46:47 -0600 Subject: Implement headers middleware --- modules/caddyhttp/staticfiles/matcher.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/caddyhttp/staticfiles/matcher.go') 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) -- cgit v1.2.3