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

fastcgi: Fix Caddyfile parsing when handle_response is used #4342

Merged
merged 1 commit into from Sep 11, 2021

Conversation

francislavoie
Copy link
Member

@francislavoie francislavoie commented Sep 11, 2021

Fixes #4322

Super simple, actually. The problem was that if handle_response contained a root directive, then it would actually get consumed ahead of time as a subdirective for php_fastcgi, breaking the tokens, triggering an error when parsing when passed down to reverse_proxy.

The fix is to only read php_fastcgi subdirectives if the nesting is 1, so we skip any that might appear within any sub-blocks.

The test fails before the change, passes after.

@francislavoie francislavoie added the bug 🐞 Something isn't working label Sep 11, 2021
@francislavoie francislavoie added this to the v2.4.6 milestone Sep 11, 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.

Fascinating. Thanks for the elegant fix and test case, too!

@mholt mholt merged commit a779e1b into master Sep 11, 2021
@mholt mholt deleted the fix-fastcgi-handle-response branch September 11, 2021 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set root inside 'handle_response' block which is in turn inside 'php_fastcgi' directive
2 participants