Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matcher format for multiple sites share same definition #395

Closed
sospartan opened this issue Jun 4, 2024 · 4 comments · Fixed by caddyserver/caddy#6616
Closed

matcher format for multiple sites share same definition #395

sospartan opened this issue Jun 4, 2024 · 4 comments · Fixed by caddyserver/caddy#6616
Labels
documentation Improvements or additions to documentation

Comments

@sospartan
Copy link

I found put a space before comma will not parsed as two hosts, for example:

abc.com , ab.com {
...
}

Is this a reasonable format? I'd like make a PR about it.
To quote the docs

If multiple sites share the same definition, you can list all of them together, either with spaces or commas.

Although the examples in the documentation are in the form of host immediately followed by a comma, this is, after all, not explicitly stated.

@mholt
Copy link
Member

mholt commented Jun 4, 2024

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 😇

I'm going to transfer this to the website repo so we can work on it there.

@mholt mholt transferred this issue from caddyserver/caddy Jun 4, 2024
@mholt mholt added the documentation Improvements or additions to documentation label Jun 4, 2024
@sospartan
Copy link
Author

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'.

@mholt
Copy link
Member

mholt commented Jun 4, 2024

We don't actually want "fault tolerant" Caddyfiles, we want consistent ones 🙂

So the current behavior is correct, but we can clarify the specifics in the docs.

@francislavoie
Copy link
Member

francislavoie commented Oct 10, 2024

Fixing the parser edgecase here caddyserver/caddy#6616

Also slight docs clarification: 6db3af5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants