mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-28 13:21:23 +08:00
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
This commit is contained in:
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user