Browse Source
* caddyfile: Fix `import` replacing unrelated placeholders See https://caddy.community/t/snippet-issue-works-outside-snippet/12231 So it turns out that `NewReplacer()` gives a replacer with some global defaults (like `{env.*}` and some system and time placeholders), which is not ideal when running `import` because we just want to replace `{args.*}` only, and nothing else. * caddyfile: Add testmaster
Francis Lavoie
4 years ago
committed by
GitHub
3 changed files with 44 additions and 1 deletions
@ -0,0 +1,31 @@ |
|||||
|
(foo) { |
||||
|
respond {env.FOO} |
||||
|
} |
||||
|
|
||||
|
:80 { |
||||
|
import foo |
||||
|
} |
||||
|
---------- |
||||
|
{ |
||||
|
"apps": { |
||||
|
"http": { |
||||
|
"servers": { |
||||
|
"srv0": { |
||||
|
"listen": [ |
||||
|
":80" |
||||
|
], |
||||
|
"routes": [ |
||||
|
{ |
||||
|
"handle": [ |
||||
|
{ |
||||
|
"body": "{env.FOO}", |
||||
|
"handler": "static_response" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue