diff options
author | Mathieu Parent <math.parent@gmail.com> | 2022-09-19 12:37:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 12:37:35 +0200 |
commit | 86653fa38eb43a5fabf7adc694c752ccb7721ffa (patch) | |
tree | ae9519dbcd99949b71f8f9d9cf3c2322f431c896 /config/security | |
parent | c46d104985b185b66a4a65d02d58043a4dc0dea0 (diff) |
config/security: Allow proxy variables in subcommands
In particular for go get
Diffstat (limited to 'config/security')
-rw-r--r-- | config/security/securityConfig.go | 2 | ||||
-rw-r--r-- | config/security/securityonfig_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/config/security/securityConfig.go b/config/security/securityConfig.go index b27481230..b5a17ac2d 100644 --- a/config/security/securityConfig.go +++ b/config/security/securityConfig.go @@ -42,7 +42,7 @@ var DefaultConfig = Config{ ), // These have been tested to work with Hugo's external programs // on Windows, Linux and MacOS. - OsEnv: NewWhitelist("(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$"), + OsEnv: NewWhitelist("(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM)$"), }, Funcs: Funcs{ Getenv: NewWhitelist("^HUGO_"), diff --git a/config/security/securityonfig_test.go b/config/security/securityonfig_test.go index 24190a57f..c8753f7fc 100644 --- a/config/security/securityonfig_test.go +++ b/config/security/securityonfig_test.go @@ -140,7 +140,7 @@ func TestToTOML(t *testing.T) { got := DefaultConfig.ToTOML() c.Assert(got, qt.Equals, - "[security]\n enableInlineShortcodes = false\n\n [security.exec]\n allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']\n\n [security.funcs]\n getenv = ['^HUGO_']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']", + "[security]\n enableInlineShortcodes = false\n\n [security.exec]\n allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM)$']\n\n [security.funcs]\n getenv = ['^HUGO_']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']", ) } |