mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Allow the HTTP_PROXY environment variable to be (mis)spelled as
"http_proxy", since some people apparently do this and fetch(3) allows it.
This commit is contained in:
parent
33f02c8e06
commit
b39855baee
2 changed files with 4 additions and 2 deletions
|
|
@ -126,6 +126,8 @@ readenv(void)
|
|||
char *proxy_auth_pass = NULL;
|
||||
|
||||
env_HTTP_PROXY = getenv("HTTP_PROXY");
|
||||
if (env_HTTP_PROXY == NULL)
|
||||
env_HTTP_PROXY = getenv("http_proxy");
|
||||
if (env_HTTP_PROXY != NULL) {
|
||||
if (strncmp(env_HTTP_PROXY, "http://", 7) == 0)
|
||||
env_HTTP_PROXY += 7;
|
||||
|
|
|
|||
|
|
@ -347,8 +347,8 @@ fetch_pick_server_init() {
|
|||
# Generate a random seed for use in picking mirrors. If HTTP_PROXY
|
||||
# is set, this will be used to generate the seed; otherwise, the seed
|
||||
# will be random.
|
||||
if [ -n "${HTTP_PROXY}" ]; then
|
||||
RANDVALUE=`sha256 -qs "${HTTP_PROXY}" |
|
||||
if [ -n "${HTTP_PROXY}${http_proxy}" ]; then
|
||||
RANDVALUE=`sha256 -qs "${HTTP_PROXY}${http_proxy}" |
|
||||
tr -d 'a-f' |
|
||||
cut -c 1-9`
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue