caddy/caddyconfig/caddyfile
Francis Lavoie b82db994f3
caddyfile: Add parse error on site address with trailing { ()
* caddyfile: Add parse error on site address in `{`

This is an incredibly common mistake made by users, so we should catch it earlier in the parser and give a more friendly message. Often it ends up adapting but with mistakes, or erroring out later due to other site addresses being read as directives.

There's not really ever a situation where a lone '{' is valid at the end of a site address (but I suppose there are edgecases where the user wants to use a path matcher where it ends specifically in `{`, but... why?), so this should be fine.

* Update caddyconfig/caddyfile/parse.go
2021-05-12 16:18:44 -06:00
..
testdata caddyfile: reject cyclic imports () 2021-04-09 12:06:25 -06:00
adapter.go caddyfile: Normalize line endings before comparing fmt result () 2021-04-02 11:55:34 -06:00
dispenser.go chore: Fix typo in dispenser.go () 2020-05-27 08:13:57 -06:00
dispenser_test.go caddyfile: Move NewTestDispenser into non-test file () 2020-05-26 13:45:22 -06:00
formatter.go caddyfile: Fix caddy fmt nesting not decrementing () 2021-05-10 12:01:27 -06:00
formatter_fuzz.go fuzz: fix the FuzzFormat comparison () 2021-04-15 23:03:54 +00:00
formatter_test.go caddyfile: Fix caddy fmt nesting not decrementing () 2021-05-10 12:01:27 -06:00
importgraph.go caddyfile: reject cyclic imports () 2021-04-09 12:06:25 -06:00
lexer.go caddyfile: reject cyclic imports () 2021-04-09 12:06:25 -06:00
lexer_fuzz.go ci: fuzz: add 4 more fuzzing targets () 2021-04-08 11:45:19 -06:00
lexer_test.go caddyfile: Export Tokenize function for lexing () 2020-07-20 13:55:51 -06:00
parse.go caddyfile: Add parse error on site address with trailing { () 2021-05-12 16:18:44 -06:00
parse_test.go caddyfile: Add parse error on site address with trailing { () 2021-05-12 16:18:44 -06:00