[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 52/173: url: --noproxy option overrides NO_PROXY en
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 52/173: url: --noproxy option overrides NO_PROXY environment variable |
Date: |
Fri, 24 Feb 2017 14:01:14 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.53.1
in repository gnurl.
commit 2ac1942c72fda6d2a1912fb4e8b6ebfc43ee9f30
Author: ERAMOTO Masaya <address@hidden>
AuthorDate: Mon Dec 19 16:27:24 2016 +0900
url: --noproxy option overrides NO_PROXY environment variable
Under condition using http_proxy env var, noproxy list was the
combination of --noproxy option and NO_PROXY env var previously. Since
this commit, --noproxy option overrides NO_PROXY environment variable
even if use http_proxy env var.
Closes #1140
---
docs/cmdline-opts/noproxy.d | 4 ++++
docs/cmdline-opts/page-footer | 10 ++++++++
lib/url.c | 3 +--
tests/data/Makefile.inc | 1 +
tests/data/test1252 | 52 +++++++++++++++++++++++++++++++++++++++++
tests/data/test1253 | 53 ++++++++++++++++++++++++++++++++++++++++++
tests/data/test1254 | 53 ++++++++++++++++++++++++++++++++++++++++++
tests/data/test1255 | 53 ++++++++++++++++++++++++++++++++++++++++++
tests/data/test1256 | 54 +++++++++++++++++++++++++++++++++++++++++++
tests/data/test1257 | 54 +++++++++++++++++++++++++++++++++++++++++++
10 files changed, 335 insertions(+), 2 deletions(-)
diff --git a/docs/cmdline-opts/noproxy.d b/docs/cmdline-opts/noproxy.d
index 4f06d9f5d..e0d2d598c 100644
--- a/docs/cmdline-opts/noproxy.d
+++ b/docs/cmdline-opts/noproxy.d
@@ -9,3 +9,7 @@ effectively disables the proxy. Each name in this list is
matched as either
a domain which contains the hostname, or the hostname itself. For example,
local.com would match local.com, local.com:80, and www.local.com, but not
www.notlocal.com.
+
+Since 7.52.2, This option overrides the environment variables that disable
+the proxy. If there's an environment variable disabling a proxy, you can set
+noproxy list to \&"" to override it.
diff --git a/docs/cmdline-opts/page-footer b/docs/cmdline-opts/page-footer
index 94412c703..c7b1ae014 100644
--- a/docs/cmdline-opts/page-footer
+++ b/docs/cmdline-opts/page-footer
@@ -23,6 +23,16 @@ Sets the proxy server to use if no protocol-specific proxy
is set.
.IP "NO_PROXY <comma-separated list of hosts>"
list of host names that shouldn't go through any proxy. If set to a asterisk
\&'*' only, it matches all hosts.
+
+Since 7.52.2, this environment variable disable the proxy even if specify
+--proxy option. That is
+.B NO_PROXY=direct.example.com curl -x http://proxy.example.com
+.B http://direct.example.com
+accesses the target URL directly, and
+.B NO_PROXY=direct.example.com curl -x http://proxy.example.com
+.B http://somewhere.example.com
+accesses the target URL through proxy.
+
.SH "PROXY PROTOCOL PREFIXES"
Since curl version 7.21.7, the proxy string may be specified with a
protocol:// prefix to specify alternative proxy protocols.
diff --git a/lib/url.c b/lib/url.c
index d1a7afe1d..1f6e5bed9 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -6252,8 +6252,7 @@ static CURLcode create_conn(struct Curl_easy *data,
else if(!proxy && !socksproxy)
#ifndef CURL_DISABLE_HTTP
/* if the host is not in the noproxy list, detect proxy. */
- if(!check_noproxy(conn->host.name, no_proxy))
- proxy = detect_proxy(conn);
+ proxy = detect_proxy(conn);
#else /* !CURL_DISABLE_HTTP */
proxy = NULL;
#endif /* CURL_DISABLE_HTTP */
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index afad1984d..471eb2510 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -128,6 +128,7 @@ test1220 test1221 test1222 test1223 test1224 test1225
test1226 test1227 \
test1228 test1229 test1230 test1231 test1232 test1233 test1234 test1235 \
test1236 test1237 test1238 test1239 test1240 test1241 test1242 test1243 \
test1244 test1245 test1246 test1247 test1248 test1249 test1250 test1251 \
+test1252 test1253 test1254 test1255 test1256 test1257 \
\
test1280 test1281 test1282 \
\
diff --git a/tests/data/test1252 b/tests/data/test1252
new file mode 100644
index 000000000..cbaef48b7
--- /dev/null
+++ b/tests/data/test1252
@@ -0,0 +1,52 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+NO_PROXY
+noproxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+
+foo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Under condition using --proxy, override NO_PROXY by --nproxy and access target
URL directly
+</name>
+<setenv>
+NO_PROXY=example.com
+</setenv>
+<command>
+http://%HOSTIP:%HTTPPORT/1252 --proxy http://%HOSTIP:%HTTPPORT --noproxy
%HOSTIP
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1252 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1253 b/tests/data/test1253
new file mode 100644
index 000000000..74002994b
--- /dev/null
+++ b/tests/data/test1253
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+NO_PROXY
+noproxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+
+foo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Under condition using --proxy, override NO_PROXY by --nproxy and access target
URL through proxy
+</name>
+<setenv>
+NO_PROXY=example.com
+</setenv>
+<command>
+http://somewhere.example.com/1253 --proxy http://%HOSTIP:%HTTPPORT --noproxy
%HOSTIP
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://somewhere.example.com/1253 HTTP/1.1
+Host: somewhere.example.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1254 b/tests/data/test1254
new file mode 100644
index 000000000..817b9342b
--- /dev/null
+++ b/tests/data/test1254
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+NO_PROXY
+noproxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+
+foo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Under condition using --proxy, override NO_PROXY by --nproxy and access target
URL through proxy
+</name>
+<setenv>
+NO_PROXY=example.com
+</setenv>
+<command>
+http://somewhere.example.com/1254 --proxy http://%HOSTIP:%HTTPPORT --noproxy ""
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://somewhere.example.com/1254 HTTP/1.1
+Host: somewhere.example.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1255 b/tests/data/test1255
new file mode 100644
index 000000000..d82310f67
--- /dev/null
+++ b/tests/data/test1255
@@ -0,0 +1,53 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+NO_PROXY
+noproxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+
+foo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Under condition using http_proxy, override NO_PROXY by --nproxy and access
target URL directly
+</name>
+<setenv>
+http_proxy=http://%HOSTIP:%HTTPPORT
+NO_PROXY=example.com
+</setenv>
+<command>
+http://%HOSTIP:%HTTPPORT/1255 --noproxy %HOSTIP
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1255 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1256 b/tests/data/test1256
new file mode 100644
index 000000000..09c59f4ff
--- /dev/null
+++ b/tests/data/test1256
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+NO_PROXY
+noproxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+
+foo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Under condition using http_proxy, override NO_PROXY by --nproxy and access
target URL through proxy
+</name>
+<setenv>
+http_proxy=http://%HOSTIP:%HTTPPORT
+NO_PROXY=example.com
+</setenv>
+<command>
+http://somewhere.example.com/1256 --noproxy %HOSTIP
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://somewhere.example.com/1256 HTTP/1.1
+Host: somewhere.example.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1257 b/tests/data/test1257
new file mode 100644
index 000000000..6b7e93736
--- /dev/null
+++ b/tests/data/test1257
@@ -0,0 +1,54 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+NO_PROXY
+noproxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 4
+Content-Type: text/html
+
+foo
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Under condition using http_proxy, override NO_PROXY by --nproxy and access
target URL through proxy
+</name>
+<setenv>
+http_proxy=http://%HOSTIP:%HTTPPORT
+NO_PROXY=example.com
+</setenv>
+<command>
+http://somewhere.example.com/1257 --noproxy ""
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://somewhere.example.com/1257 HTTP/1.1
+Host: somewhere.example.com
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</protocol>
+</verify>
+</testcase>
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 42/173: http2_send: avoid unsigned integer wrap around, (continued)
- [GNUnet-SVN] [gnurl] 42/173: http2_send: avoid unsigned integer wrap around, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 69/173: http: print correct HTTP string in verbose output when using HTTP/2, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 43/173: smtp: Fix STARTTLS denied error message, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 36/173: lib506: fix build for Open Watcom, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 38/173: examples: make the C++ examples follow our code style too, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 49/173: IDN: Use TR46 'transitional' for toASCII translations, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 62/173: RELEASE-NOTES: synced with a7c73ae309c, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 25/173: curl.h: CURLE_FUNCTION_NOT_FOUND is no longer in use, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 41/173: cmake: Fix passing _WINSOCKAPI_ macro to compiler, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 54/173: IDN: revert use of the transitional option, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 52/173: url: --noproxy option overrides NO_PROXY environment variable,
gnunet <=
- [GNUnet-SVN] [gnurl] 46/173: url: Fix parsing for when 'file' is the default protocol, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 34/173: COPYING: update the generic copyright year range, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 94/173: TODO: remove "Support TLS v1.3", gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 100/173: docs: proofread README.netware README.win32, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 128/173: cmdline-opts/page-footer: ftp.sunet.se is no longer an FTP mirror, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 47/173: gnutls: check for alpn and ocsp in configure, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 82/173: sws: use SOCKERRNO, not errno, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 60/173: write-out.d: 'time_total' is not always shown with ms precision, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 63/173: THANKS-filter: Jiri Malak, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 56/173: CURLOPT_PREQUOTE.3: takes a struct curl_slist*, not a char*, gnunet, 2017/02/24