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

fileserver: fix try_policy when instantiating file matcher from CEL #6624

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

effleurager
Copy link
Contributor

I found a minor bug in #6623 for the file matcher when written as a CEL expression.

This PR corrects the current reassignment of root, and adds a test to ensure the correct property is set.

@francislavoie
Copy link
Member

Thanks!

I'm not sure that test properly covers it though? Wouldn't it need more than one try_files at least to tell them apart with that policy? I figure it could be tricky tho because git might make those test files have the same mod time though 🤔 not sure how to best test that.

@francislavoie francislavoie added the bug 🐞 Something isn't working label Oct 20, 2024
@francislavoie
Copy link
Member

I reworked the test to use largest_size which we can guarantee when using Git (since file mod time is based on when you checkout the changes etc), and validating that it does indeed pick the correct file by checking the value in the replacer.

@francislavoie francislavoie enabled auto-merge (squash) October 20, 2024 14:02
@francislavoie francislavoie merged commit 9753c44 into caddyserver:master Oct 20, 2024
33 checks passed
@mholt
Copy link
Member

mholt commented Oct 21, 2024

Thanks both!

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.

3 participants