diff options
author | ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com> | 2016-12-19 16:27:24 +0900 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-01-13 11:18:29 +0100 |
commit | 2ac1942c72fda6d2a1912fb4e8b6ebfc43ee9f30 (patch) | |
tree | 7b0bc441f7d466da9e142517a866f1f104b5f27f /tests | |
parent | efdbfde7ca205f256c4e8b473c775cf73557cfd7 (diff) | |
download | curl-2ac1942c72fda6d2a1912fb4e8b6ebfc43ee9f30.tar.gz |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/Makefile.inc | 1 | ||||
-rw-r--r-- | tests/data/test1252 | 52 | ||||
-rw-r--r-- | tests/data/test1253 | 53 | ||||
-rw-r--r-- | tests/data/test1254 | 53 | ||||
-rw-r--r-- | tests/data/test1255 | 53 | ||||
-rw-r--r-- | tests/data/test1256 | 54 | ||||
-rw-r--r-- | tests/data/test1257 | 54 |
7 files changed, 320 insertions, 0 deletions
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> |