]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
config/security: Allow proxy variables in subcommands
authorMathieu Parent <math.parent@gmail.com>
Mon, 19 Sep 2022 10:37:35 +0000 (12:37 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Sep 2022 10:37:35 +0000 (12:37 +0200)
In particular for go get

config/security/securityConfig.go
config/security/securityonfig_test.go
docs/data/docs.json

index b274812309960494d8c6f84540502f9882418e51..b5a17ac2d1877801f7b762f3f8d74753aa91dcba 100644 (file)
@@ -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_"),
index 24190a57ff77c3a6e29e3da9c912a5a8de2be660..c8753f7fc7facaae71e40cf8613dc4d72ffa34f6 100644 (file)
@@ -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 = ['.*']",
        )
 }
 
index fe4efeb22e8249a8502caaa418b18507d1ddee0f..b41cb351dcad2bb315854966341c884a3c0d53db 100644 (file)
           "^postcss$"
         ],
         "osEnv": [
-          "(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$"
+          "(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM)$"
         ]
       },
       "funcs": {