diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2021-05-19 10:47:06 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2021-05-19 10:47:06 -0600 |
commit | c052162203654d9fcb6f3a40b1c9b376b8e618d1 (patch) | |
tree | ed168c63505b98d378d2513b2a235742701d1db9 /caddyconfig/caddyfile | |
parent | 7f26a6b3e507cef98c2d4a74384bacf53bc58f57 (diff) | |
parent | b82db994f39c6991d673a7ae9836f5454b1f9668 (diff) |
Merge branch '2.4'
Diffstat (limited to 'caddyconfig/caddyfile')
-rwxr-xr-x | caddyconfig/caddyfile/parse.go | 5 | ||||
-rwxr-xr-x | caddyconfig/caddyfile/parse_test.go | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/caddyconfig/caddyfile/parse.go b/caddyconfig/caddyfile/parse.go index 96491bb..d870765 100755 --- a/caddyconfig/caddyfile/parse.go +++ b/caddyconfig/caddyfile/parse.go @@ -214,6 +214,11 @@ func (p *parser) addresses() error { break } + // Users commonly forget to place a space between the address and the '{' + if strings.HasSuffix(tkn, "{") { + return p.Errf("Site addresses cannot end with a curly brace: '%s' - put a space between the token and the brace", tkn) + } + if tkn != "" { // empty token possible if user typed "" // Trailing comma indicates another address will follow, which // may possibly be on the next line diff --git a/caddyconfig/caddyfile/parse_test.go b/caddyconfig/caddyfile/parse_test.go index 3c7db79..12c7139 100755 --- a/caddyconfig/caddyfile/parse_test.go +++ b/caddyconfig/caddyfile/parse_test.go @@ -160,6 +160,10 @@ func TestParseOneAndImport(t *testing.T) { "localhost", }, []int{}}, + {`localhost{ + dir1 + }`, true, []string{}, []int{}}, + {`localhost dir1 { nested { |