diff options
author | Jack Baron <jackmbaron@gmail.com> | 2020-12-09 18:28:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 11:28:14 -0700 |
commit | c898a37f4080fe3013974bee9a44ce98bd900cc3 (patch) | |
tree | 14f9bf7d2259f83040031bda93d548badfd54449 /caddytest/integration/caddyfile_adapt | |
parent | 31fbcd74016f35c4edf89b5de9c8a519663d588b (diff) |
httpcaddyfile: support matching headers that do not exist (#3909)
* add integration test for null header matcher
* implement null header matcher syntax
* avoid repeating magic !
* check for field following ! character
Diffstat (limited to 'caddytest/integration/caddyfile_adapt')
-rw-r--r-- | caddytest/integration/caddyfile_adapt/matcher_syntax.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt index c5c2760..019ce14 100644 --- a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt +++ b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt @@ -31,6 +31,12 @@ query bar=baz } respond @matcher8 "query matcher merging pairs with the same keys" + + @matcher9 { + header !Foo + header Bar foo + } + respond @matcher9 "header matcher with null field matcher" } ---------- { @@ -183,6 +189,24 @@ "handler": "static_response" } ] + }, + { + "match": [ + { + "header": { + "Bar": [ + "foo" + ], + "Foo": null + } + } + ], + "handle": [ + { + "body": "header matcher with null field matcher", + "handler": "static_response" + } + ] } ] } |