Skip to content

Commit b0c3fa3

Browse files
author
Edward Thomson
authored
Merge pull request libgit2#4112 from cbargren/fix/proxy-env-vars
Add support for lowercase proxy environment variables
2 parents 683ff4f + 61189a1 commit b0c3fa3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/remote.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,12 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
770770
goto found;
771771
}
772772

773-
/* HTTP_PROXY / HTTPS_PROXY environment variables */
774-
error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY");
773+
/* http_proxy / https_proxy environment variables */
774+
error = git__getenv(&val, use_ssl ? "https_proxy" : "http_proxy");
775+
776+
/* try uppercase environment variables */
777+
if (error == GIT_ENOTFOUND)
778+
error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY");
775779

776780
if (error < 0) {
777781
if (error == GIT_ENOTFOUND) {

0 commit comments

Comments
 (0)