-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
celFileMatcherMacroExpander()
does not accept "try_files" map entry with a Comprehension
value
#6623
Comments
Due to how matchers are provisioned (once at config load time, not on every request), they need to have static values as input (except for placeholders). I'm not sure it would be possible to implement this. From a type system standpoint I don't see how the MatchFile struct could take a dynamic try_files input fed by CEL. In your case, can't you just list out all 10 permutations you want to try? That should work, no? The config is verbose yes, but it should work. |
While testing, I discovered a bug with the caddy/modules/caddyhttp/fileserver/matcher.go Lines 192 to 195 in 48ce47f
I'm preparing a PR, but I'm wondering if I should add a test for caddy/modules/caddyhttp/fileserver/matcher_test.go Lines 283 to 292 in 48ce47f
|
Oops! Nice spotting. Yeah any kind of tests you can add are appreciated 😅 |
Looking at the documentation for the file matcher, the example CEL expression uses an array of strings to specify a list of files to search for. Seeming like the only alternative to globbing for Windows users, I was surprised to find building a list failed to compile with the following error:
As a toy example, this seems like it should be a valid Caddyfile:
Given the severe restriction of globbing being unavailable, this seems like an important fallback to have?
The text was updated successfully, but these errors were encountered: