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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

caddyfile: Prevent invalid site addresses with comma #4302

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

francislavoie
Copy link
Member

@francislavoie francislavoie commented Aug 22, 2021

Some users forget to use a comma between their site addresses. This is invalid (commas aren't a valid character in domains) and later parts of the code like certificate automation will try to use this otherwise, which doesn't make sense. Best to error as early as possible.

Example thread on the forums where this happened: https://caddy.community/t/simplify-caddyfile/13281/9

foo.example.com,bar.example.com
respond "foo"

馃憞

$ caddy adapt
2021/08/22 19:29:44.950 INFO    using adjacent Caddyfile
adapt: Caddyfile:1 - Error during parsing: Site addresses cannot contain a comma ',': 'foo.example.com,bar.example.com' - put a space after the comma to separate site addresses

Some users forget to use a comma between their site addresses. This is invalid (commas aren't a valid character in domains) and later parts of the code like certificate automation will try to use this otherwise, which doesn't make sense. Best to error as early as possible.

Example thread on the forums where this happened: https://caddy.community/t/simplify-caddyfile/13281/9
@francislavoie francislavoie added the under review 馃 Review is pending before merging label Aug 22, 2021
@francislavoie francislavoie added this to the v2.4.4 milestone Aug 22, 2021
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks. This does seem to be a common mistake.

@mholt mholt merged commit d74913f into master Aug 23, 2021
@mholt mholt deleted the site-address-comma branch August 23, 2021 17:26
@mholt mholt removed the under review 馃 Review is pending before merging label Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants