From 0cae2010440de8757a3a15792892d52d8e158bd6 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 19 Feb 2008 21:57:41 +0000 Subject: [PATCH] Added test309 to test HTTP redirect to HTTPS URL --- CHANGES | 3 ++ tests/data/Makefile.am | 2 +- tests/data/test309 | 86 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 tests/data/test309 diff --git a/CHANGES b/CHANGES index 014e2ec70..3b4499a3b 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,9 @@ Changelog +Daniel Fandrich (19 Feb 2007) +- Added test309 to test HTTP redirect to HTTPS URL + Daniel S (18 Feb 2008) - We're no longer providing a very old ca-bundle in the curl tarball. You can get a fresh one downloaded and created with 'make ca-bundle' or you can get 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 @@ + + + +HTTP +HTTPS +HTTP GET +followlocation + + + +# Server-side + + +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 + + + +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 + + + +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 + + + + +# Client-side + + +SSL + + +http +https + + +HTTP Location: redirect to HTTPS URL + + +-k http://%HOSTIP:%HTTPPORT/want/309 -L + +# The data section doesn't do variable substitution, so we must assert this + +perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%HTTPSPORT' ne '8991' );" + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /want/309 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /data/3090002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPSPORT +Accept: */* + + + +