summaryrefslogtreecommitdiff
path: root/caddytest
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-05-11 16:38:33 -0400
committerGitHub <noreply@github.com>2020-05-11 14:38:33 -0600
commit4c55d26f11329243591d04ca5a52298b38bca9a8 (patch)
tree27557f2dd51e711d455434b9d760a55651406388 /caddytest
parentd5341625561bf67c40241a4fb649b0a4991e71b2 (diff)
caddyhttp: Fix merging of Caddyfile matchers in not blocks (#3379)
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt_test.go54
1 files changed, 53 insertions, 1 deletions
diff --git a/caddytest/integration/caddyfile_adapt_test.go b/caddytest/integration/caddyfile_adapt_test.go
index f6120ae..514a506 100644
--- a/caddytest/integration/caddyfile_adapt_test.go
+++ b/caddytest/integration/caddyfile_adapt_test.go
@@ -362,4 +362,56 @@ func TestMatcherSyntax(t *testing.T) {
}
}
}`)
-} \ No newline at end of file
+}
+
+func TestNotBlockMerging(t *testing.T) {
+ caddytest.AssertAdapt(t, `
+ :80
+
+ @test {
+ not {
+ header Abc "123"
+ header Bcd "123"
+ }
+ }
+ respond @test 403
+ `, "caddyfile", `{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":80"
+ ],
+ "routes": [
+ {
+ "match": [
+ {
+ "not": [
+ {
+ "header": {
+ "Abc": [
+ "123"
+ ],
+ "Bcd": [
+ "123"
+ ]
+ }
+ }
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "handler": "static_response",
+ "status_code": 403
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+}`)
+}