From 4fc570711e170da2bd1164966d2c47f9dc3d3d6d Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 17 Nov 2020 11:29:43 -0700 Subject: caddyhttp: Fix header matcher when using nil Uncovered in #3807 --- modules/caddyhttp/matchers.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/caddyhttp/matchers.go') 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 { -- cgit v1.2.3