summaryrefslogtreecommitdiff
path: root/caddyconfig/httpcaddyfile/httptype_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'caddyconfig/httpcaddyfile/httptype_test.go')
-rw-r--r--caddyconfig/httpcaddyfile/httptype_test.go52
1 files changed, 52 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype_test.go b/caddyconfig/httpcaddyfile/httptype_test.go
index b0ee3ac..233e374 100644
--- a/caddyconfig/httpcaddyfile/httptype_test.go
+++ b/caddyconfig/httpcaddyfile/httptype_test.go
@@ -164,6 +164,58 @@ func TestGlobalOptions(t *testing.T) {
expectWarn: false,
expectError: true,
},
+ {
+ input: `
+ {
+ admin {
+ enforce_origin
+ origins 192.168.1.1:2020 127.0.0.1:2020
+ }
+ }
+ :80
+ `,
+ expectWarn: false,
+ expectError: false,
+ },
+ {
+ input: `
+ {
+ admin 127.0.0.1:2020 {
+ enforce_origin
+ origins 192.168.1.1:2020 127.0.0.1:2020
+ }
+ }
+ :80
+ `,
+ expectWarn: false,
+ expectError: false,
+ },
+ {
+ input: `
+ {
+ admin 192.168.1.1:2020 127.0.0.1:2020 {
+ enforce_origin
+ origins 192.168.1.1:2020 127.0.0.1:2020
+ }
+ }
+ :80
+ `,
+ expectWarn: false,
+ expectError: true,
+ },
+ {
+ input: `
+ {
+ admin off {
+ enforce_origin
+ origins 192.168.1.1:2020 127.0.0.1:2020
+ }
+ }
+ :80
+ `,
+ expectWarn: false,
+ expectError: true,
+ },
} {
adapter := caddyfile.Adapter{