diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2008-02-19 21:57:41 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2008-02-19 21:57:41 +0000 |
commit | 0cae2010440de8757a3a15792892d52d8e158bd6 (patch) | |
tree | 80248b40149360e0b6abb726bf957570863bbab3 /tests/data | |
parent | 9df37b93df57488c21bd2027da070193ea4883a6 (diff) | |
download | curl-0cae2010440de8757a3a15792892d52d8e158bd6.tar.gz |
Added test309 to test HTTP redirect to HTTPS URL
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/Makefile.am | 2 | ||||
-rw-r--r-- | tests/data/test309 | 86 |
2 files changed, 87 insertions, 1 deletions
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 826b557a6..1cc19f12a 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -48,7 +48,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \ test2000 test2001 test2002 test2003 test35 test544 test545 test2004 \ test546 test1013 test1014 test1015 test547 test548 test549 test550 \ test551 test552 test1016 test1017 test1018 test1019 test1020 test553 \ - test1021 test1022 test1023 + test1021 test1022 test1023 test309 filecheck: @mkdir test-place; \ diff --git a/tests/data/test309 b/tests/data/test309 new file mode 100644 index 000000000..dd0431206 --- /dev/null +++ b/tests/data/test309 @@ -0,0 +1,86 @@ +<testcase> +<info> +<keywords> +HTTP +HTTPS +HTTP GET +followlocation +</keywords> +</info> + +# Server-side +<reply> +<data> +HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes
+Connection: close
+
+This server reply is for testing a simple Location: following to HTTPS URL + +</data> +<data2> +HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked + +</data2> +<datacheck> +HTTP/1.1 301 This is a weirdo text message swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes
+Connection: close
+
+HTTP/1.1 200 Followed here fine swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 52
+
+If this is received, the location following worked + +</datacheck> +</reply> + +# Client-side +<client> +<features> +SSL +</features> +<server> +http +https +</server> + <name> +HTTP Location: redirect to HTTPS URL + </name> + <command> +-k http://%HOSTIP:%HTTPPORT/want/309 -L +</command> +# The data section doesn't do variable substitution, so we must assert this +<precheck> +perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%HTTPSPORT' ne '8991' );" +</precheck> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /want/309 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /data/3090002.txt?coolsite=yes HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+Accept: */*
+
+</protocol> +</verify> +</testcase> |