summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorChristopher Bargren <cbargren@gmail.com>2017-02-07 16:33:28 -0700
committerChristopher Bargren <cbargren@gmail.com>2017-02-08 15:01:24 -0700
commit5f3276c7e66fe54b0485da2def84a6ae322cce59 (patch)
treedfb42b1205b2ef82ba6ce19e1c3885b688b7cd3d /src/remote.c
parent887c1931a293cc6bb2687fea7a8303ab3e8fbc7e (diff)
downloadlibgit2-5f3276c7e66fe54b0485da2def84a6ae322cce59.tar.gz
Add support for lowercase proxy environment variables
curl supports HTTPS_PROXY in addition to https_proxy (and their http counterparts). This change ensures parity with curl's behavior.
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/remote.c b/src/remote.c
index 8da7346fb..1f5c58bd2 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -774,6 +774,18 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY");
if (error < 0) {
+ if (error != GIT_ENOTFOUND) {
+ return error;
+ }
+
+ giterr_clear();
+ error = 0;
+ }
+
+ /* try lowercase environment variables */
+ error = git__getenv(&val, use_ssl ? "https_proxy" : "http_proxy");
+
+ if (error < 0) {
if (error == GIT_ENOTFOUND) {
giterr_clear();
error = 0;