Commit 0cae2010 authored by Dan Fandrich's avatar Dan Fandrich
Browse files

Added test309 to test HTTP redirect to HTTPS URL

parent 9df37b93
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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; \

tests/data/test309

0 → 100644
+86 −0
Original line number Diff line number Diff line
<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>