caddyhttp: Fix header matcher when using nil

Uncovered in #3807
This commit is contained in:
Matthew Holt 2020-11-17 11:29:43 -07:00
parent 99b8f44486
commit 4fc570711e
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
2 changed files with 14 additions and 0 deletions

View file

@ -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 {