Skip to content

Commit 5f3276c

Browse files
committed
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.
1 parent 887c193 commit 5f3276c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/remote.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,18 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
773773
/* HTTP_PROXY / HTTPS_PROXY environment variables */
774774
error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY");
775775

776+
if (error < 0) {
777+
if (error != GIT_ENOTFOUND) {
778+
return error;
779+
}
780+
781+
giterr_clear();
782+
error = 0;
783+
}
784+
785+
/* try lowercase environment variables */
786+
error = git__getenv(&val, use_ssl ? "https_proxy" : "http_proxy");
787+
776788
if (error < 0) {
777789
if (error == GIT_ENOTFOUND) {
778790
giterr_clear();

0 commit comments

Comments
 (0)