Open sospartan opened 1 month ago
We should probably state that in the docs: there should be a space after the comma, not before. What you have there looks weird IMO :innocent:
I'm going to transfer this to the website repo so we can work on it there.
https://github.com/caddyserver/caddy/blob/e7ecc7ede2f0f749530b0c2e685b99954b9591ce/caddyconfig/caddyfile/parse.go#L260
Noticed here is already handle the situation comma without space. I agreed these looks wired too. But I think support use comma to separating sites no matter spaces will make caddyfile's syntax more fault tolerant. Space is quite easily neglected. And the 'wired' part may handle it in 'formatter'.
We don't actually want "fault tolerant" Caddyfiles, we want consistent ones :slightly_smiling_face:
So the current behavior is correct, but we can clarify the specifics in the docs.
I found put a space before comma will not parsed as two hosts, for example:
Is this a reasonable format? I'd like make a PR about it. To quote the docs
Although the examples in the documentation are in the form of host immediately followed by a comma, this is, after all, not explicitly stated.