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

httpcaddyfile: support matching headers that do not exist #3909

Merged

Conversation

luludotdev
Copy link
Contributor

Closes #3907

@CLAassistant
Copy link

CLAassistant commented Dec 9, 2020

CLA assistant check
All committers have signed the CLA.

@luludotdev luludotdev marked this pull request as ready for review December 9, 2020 00:33
@luludotdev
Copy link
Contributor Author

Tests are green, but the code might not be super nice. Any feedback is appreciated 😄
Additionally, I'm not super happy with the error messages so if someone has any input on that too, that'd be grand.

francislavoie
francislavoie previously approved these changes Dec 9, 2020
Copy link
Member

@francislavoie francislavoie left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@francislavoie francislavoie added this to the v2.3.0 milestone Dec 9, 2020
@francislavoie francislavoie added the under review 🧐 Review is pending before merging label Dec 9, 2020
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.

LGTM, just one nit for code maintainability.

Also could we add a check to make sure that there is in fact a field name after the ! (i.e. len(field) > 1)?

modules/caddyhttp/matchers.go Outdated Show resolved Hide resolved
@mholt mholt removed the under review 🧐 Review is pending before merging label Dec 9, 2020
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.

Cool, thanks for the enhancement!

@mholt mholt merged commit c898a37 into caddyserver:master Dec 9, 2020
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.

caddyfile: allow null values on header matchers
4 participants