]> git.ipfire.org Git - thirdparty/git.git/blobdiff - http.c
http: honor no_http env variable to bypass proxy
[thirdparty/git.git] / http.c
diff --git a/http.c b/http.c
index dfc53c1e2554e76126459d6cb1f098facac28593..ad3fddf5cc48a3e28f082564913e31ecd6b92bd8 100644 (file)
--- a/http.c
+++ b/http.c
@@ -62,6 +62,7 @@ static long curl_low_speed_limit = -1;
 static long curl_low_speed_time = -1;
 static int curl_ftp_no_epsv;
 static const char *curl_http_proxy;
+static const char *curl_no_proxy;
 static const char *http_proxy_authmethod;
 static struct {
        const char *name;
@@ -594,6 +595,11 @@ static CURL *get_curl_handle(void)
                }
 
                curl_easy_setopt(result, CURLOPT_PROXY, proxy_auth.host);
+#if LIBCURL_VERSION_NUM >= 0x071304
+               var_override(&curl_no_proxy, getenv("NO_PROXY"));
+               var_override(&curl_no_proxy, getenv("no_proxy"));
+               curl_easy_setopt(result, CURLOPT_NOPROXY, curl_no_proxy);
+#endif
        }
        init_curl_proxy_auth(result);