Commit 543b91b
authored
fix(caddyfile): bump expansion limits (#9)
A single maxSnippetExpansions of 1000 could be too low for some real
world scenarios. Snippet-based configuration can be used broadly
across large CoreDNS Corefiles. We cannot implement a pure
“import depth” integer with the current splice-then-continue parser
because imports are expanded by lexing and splicing tokens into the
stream, not by recursive function calls.
Instead, we introduce high default per-directive caps for snippet and
file imports, keeping globs counted as one. Prevent trivial snippet
self-import. Add tests that lower caps to validate failure on
cycles and success with large glob imports.
This should present a good enough middleground, instead of rewriting
the parser.
Signed-off-by: Ville Vesilehto <[email protected]>1 parent fabd98a commit 543b91b
2 files changed
+38
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
271 | | - | |
| 276 | + | |
272 | 277 | | |
273 | 278 | | |
274 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| |||
801 | 808 | | |
802 | 809 | | |
803 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
0 commit comments