From 8774c9070944b91828c0c18bcb1879ee162b51d9 Mon Sep 17 00:00:00 2001 From: Michael Banzon Date: Thu, 5 Nov 2015 18:12:06 +0100 Subject: [PATCH] Removed the Windows part. It wasn't working properly. For issue #304. --- caddy/parse/parsing.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/caddy/parse/parsing.go b/caddy/parse/parsing.go index 96005881f..2df2dfdd1 100644 --- a/caddy/parse/parsing.go +++ b/caddy/parse/parsing.go @@ -9,8 +9,7 @@ import ( ) var ( - unixEnvRegEx = regexp.MustCompile("{\\$[^}]+}") - windowsEnvRegEx = regexp.MustCompile("{%[^}]+%}") + envRegEx = regexp.MustCompile("{\\$[^}]+}") ) type parser struct { @@ -338,18 +337,11 @@ func (sb serverBlock) HostList() []string { } func getValFromEnv(s string) string { - envRefsUnix := unixEnvRegEx.FindAllString(s, -1) + envRefs := envRegEx.FindAllString(s, -1) - for _, ref := range envRefsUnix { + for _, ref := range envRefs { s = strings.Replace(s, ref, os.Getenv(ref[2:len(ref)-1]), -1) } - envRefsWin := unixEnvRegEx.FindAllString(s, -1) - - for _, ref := range envRefsWin { - s = strings.Replace(s, ref, os.Getenv(ref[2:len(ref)-2]), -1) - } - return s - }