Skip to content

Commit f4a48e8

Browse files
committed
Merge branch 'jx/http-no-proxy'
* jx/http-no-proxy: http: honor no_http env variable to bypass proxy
2 parents e80aae5 + d445fda commit f4a48e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

http.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static long curl_low_speed_limit = -1;
7070
static long curl_low_speed_time = -1;
7171
static int curl_ftp_no_epsv;
7272
static const char *curl_http_proxy;
73+
static const char *curl_no_proxy;
7374
static const char *http_proxy_authmethod;
7475
static struct {
7576
const char *name;
@@ -624,6 +625,11 @@ static CURL *get_curl_handle(void)
624625
}
625626

626627
curl_easy_setopt(result, CURLOPT_PROXY, proxy_auth.host);
628+
#if LIBCURL_VERSION_NUM >= 0x071304
629+
var_override(&curl_no_proxy, getenv("NO_PROXY"));
630+
var_override(&curl_no_proxy, getenv("no_proxy"));
631+
curl_easy_setopt(result, CURLOPT_NOPROXY, curl_no_proxy);
632+
#endif
627633
}
628634
init_curl_proxy_auth(result);
629635

0 commit comments

Comments
 (0)