diff options
-rw-r--r-- | caddyconfig/httpcaddyfile/httptype.go | 1 | ||||
-rw-r--r-- | modules/caddyhttp/fileserver/matcher.go | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index beee2d1a5..c169b92af 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -1532,6 +1532,7 @@ func parseMatcherDefinitions(d *caddyfile.Dispenser, matchers map[string]caddy.M matchers[definitionName][matcherName] = caddyconfig.JSON(rm, nil) return nil } + // nolint:staticcheck if rm, ok := unm.(caddyhttp.RequestMatcher); ok { matchers[definitionName][matcherName] = caddyconfig.JSON(rm, nil) return nil diff --git a/modules/caddyhttp/fileserver/matcher.go b/modules/caddyhttp/fileserver/matcher.go index e78c99ec2..c42907491 100644 --- a/modules/caddyhttp/fileserver/matcher.go +++ b/modules/caddyhttp/fileserver/matcher.go @@ -173,7 +173,7 @@ func (m *MatchFile) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { func (MatchFile) CELLibrary(ctx caddy.Context) (cel.Library, error) { requestType := cel.ObjectType("http.Request") - matcherFactory := func(data ref.Val) (caddyhttp.RequestMatcher, error) { + matcherFactory := func(data ref.Val) (caddyhttp.RequestMatcherWithError, error) { values, err := caddyhttp.CELValueToMapStrList(data) if err != nil { return nil, err @@ -315,6 +315,7 @@ func (m MatchFile) Validate() error { func (m MatchFile) Match(r *http.Request) bool { match, err := m.selectFile(r) if err != nil { + // nolint:staticcheck caddyhttp.SetVar(r.Context(), caddyhttp.MatcherErrorVarKey, err) } return match |