]> granicus.if.org Git - curl/commitdiff
Added test309 to test HTTP redirect to HTTPS URL
authorDan Fandrich <dan@coneharvesters.com>
Tue, 19 Feb 2008 21:57:41 +0000 (21:57 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 19 Feb 2008 21:57:41 +0000 (21:57 +0000)
CHANGES
tests/data/Makefile.am
tests/data/test309 [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 014e2ec7069d5f958c36932084d1db4fcadce1a5..3b4499a3b9d8f522aa800f870f2d2d49b1dd8663 100644 (file)
--- 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
index 826b557a62d53d2bb0af37ce9a341d45a25f27cb..1cc19f12a4b4f94c174af829ea03fc1343f28c2c 100644 (file)
@@ -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 (file)
index 0000000..dd04312
--- /dev/null
@@ -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\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes\r
+Connection: close\r
+\r
+This server reply is for testing a simple Location: following to HTTPS URL
+
+</data>
+<data2>
+HTTP/1.1 200 Followed here fine swsclose\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 52\r
+\r
+If this is received, the location following worked
+
+</data2>
+<datacheck>
+HTTP/1.1 301 This is a weirdo text message swsclose\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Location: https://127.0.0.1:8991/data/3090002.txt?coolsite=yes\r
+Connection: close\r
+\r
+HTTP/1.1 200 Followed here fine swsclose\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 52\r
+\r
+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\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+\r
+GET /data/3090002.txt?coolsite=yes HTTP/1.1\r
+Host: %HOSTIP:%HTTPSPORT\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>