@marcel91200 / caddy Mirror · read-only / commits / 063ed1e7
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

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

Zaq? Wiedmann committed Feb 26, 2020 at 15:06 UTC 063ed1e7f91b578c705147cb411d076865195174
1 file changed +1 -1
caddyconfig/caddyfile/parse.go
+1 -1
@@ -64,7 +64,7 @@ func replaceEnvVars(input []byte) ([]byte, error) {
64 }
65
66 // get the value of the environment variable
67 - envVarValue := []byte(os.Getenv(string(envVarName)))
67 + envVarValue := []byte(os.ExpandEnv(os.Getenv(string(envVarName))))
68
69 // splice in the value
70 input = append(input[:begin],