diff options
author | septs <github@septs.pw> | 2022-12-02 19:13:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 12:13:34 +0100 |
commit | dc44bca963b0035818d4521b73c39af63db3a230 (patch) | |
tree | 81ea54de58b602c3853524ad320593f4c3b49738 /config/security | |
parent | ef518485cec947464509d290e6edb237c833c379 (diff) |
config/security: Add CI env var to whitelist
Diffstat (limited to 'config/security')
-rw-r--r-- | config/security/securityConfig.go | 2 | ||||
-rw-r--r-- | config/security/securityConfig_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/config/security/securityConfig.go b/config/security/securityConfig.go index b5a17ac2d..979c40125 100644 --- a/config/security/securityConfig.go +++ b/config/security/securityConfig.go @@ -45,7 +45,7 @@ var DefaultConfig = Config{ OsEnv: NewWhitelist("(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM)$"), }, Funcs: Funcs{ - Getenv: NewWhitelist("^HUGO_"), + Getenv: NewWhitelist("^HUGO_", "^CI$"), }, HTTP: HTTP{ URLs: NewWhitelist(".*"), diff --git a/config/security/securityConfig_test.go b/config/security/securityConfig_test.go index c8753f7fc..c34af9efa 100644 --- a/config/security/securityConfig_test.go +++ b/config/security/securityConfig_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)^((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 = ['.*']", + "[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_', '^CI$']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']", ) } |