summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/matchers.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-11-17 11:29:43 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2020-11-17 11:29:43 -0700
commit4fc570711e170da2bd1164966d2c47f9dc3d3d6d (patch)
tree66ed37137b09335bcba29ad61cfe7827e85de531 /modules/caddyhttp/matchers.go
parent99b8f44486b766f220a33906d84ac05af942f260 (diff)
caddyhttp: Fix header matcher when using nil
Uncovered in #3807
Diffstat (limited to 'modules/caddyhttp/matchers.go')
-rw-r--r--modules/caddyhttp/matchers.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index b7a304f..d641cb6 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -445,6 +445,10 @@ func matchHeaders(input, against http.Header, host string) bool {
// match if the header field exists at all
continue
}
+ if allowedFieldVals == nil && actualFieldVals == nil {
+ // a nil list means match if the header does not exist at all
+ continue
+ }
var match bool
fieldVals:
for _, actualFieldVal := range actualFieldVals {