caddyfile: expand environment variables within caddy files (#3082)

Small expansion to the work done in https://github.com/caddyserver/caddy/pull/2963 which simply calls `os.ExpandEnv` so env vars like `{$URL}` where `$URL=$SCHEME://$HOST:$PORT` (contrived) get the expanded $SCHEME, $HOST, and $PORT variables included
This commit is contained in:
Zaq? Wiedmann 2020-02-26 15:06:34 -08:00 committed by GitHub
parent 2de0acc11f
commit 063ed1e7f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ func replaceEnvVars(input []byte) ([]byte, error) {
}
// get the value of the environment variable
envVarValue := []byte(os.Getenv(string(envVarName)))
envVarValue := []byte(os.ExpandEnv(os.Getenv(string(envVarName))))
// splice in the value
input = append(input[:begin],