diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 48a05a4ff5..0f4e2c1386 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -208,7 +208,7 @@ test1540 test1541 test1542 test1543 test1544 test1545 test1546 \ test1550 test1551 test1552 test1553 test1554 test1555 test1556 test1557 \ test1558 test1559 test1560 test1561 test1562 test1563 test1564 test1565 \ test1566 test1567 test1568 test1569 test1570 test1571 test1572 test1573 \ -test1574 test1575 test1576 test1577 test1578 test1579 test1580 \ +test1574 test1575 test1576 test1577 test1578 test1579 test1580 test1581 \ \ test1590 test1591 test1592 test1593 test1594 test1595 test1596 test1597 \ test1598 \ diff --git a/tests/data/test1581 b/tests/data/test1581 new file mode 100644 index 0000000000..2979e5f075 --- /dev/null +++ b/tests/data/test1581 @@ -0,0 +1,97 @@ + + + +CURLFOLLOW_OBEYCODE +CURLOPT_FOLLOWLOCATION + + +# +# Server-side + + +HTTP/1.1 301 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Location: %TESTNUMBER0001 +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +-foo- + + +HTTP/1.1 200 OK +Content-Length: 6 +Connection: close +Content-Type: text/html + +-bar- + + +HTTP/1.1 301 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Location: %TESTNUMBER0001 +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +HTTP/1.1 200 OK +Content-Length: 6 +Connection: close +Content-Type: text/html + +-bar- + + + +# Client-side + + +http + + +http + + +lib1571 + + + +CURLFOLLOW_OBEYCODE with custom POST301 method, 301 => custom + + +http://%HOSTIP:%HTTPPORT/%TESTNUMBER 1581 + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +IGLOO /%TESTNUMBER HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +mooIGLOO /%TESTNUMBER0001 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 3 +Content-Type: application/x-www-form-urlencoded + +moo + + + diff --git a/tests/libtest/lib1571.c b/tests/libtest/lib1571.c index 8eaab6e6e3..3a12642efe 100644 --- a/tests/libtest/lib1571.c +++ b/tests/libtest/lib1571.c @@ -46,9 +46,12 @@ CURLcode test(char *URL) test_setopt(curl, CURLOPT_HEADER, 1L); test_setopt(curl, CURLOPT_VERBOSE, 1L); test_setopt(curl, CURLOPT_URL, URL); - if((testno == 1571) || (testno == 1575)) { + if((testno == 1571) || (testno == 1575) || (testno == 1581)) { test_setopt(curl, CURLOPT_POSTFIELDS, "moo"); } + if(testno == 1581) { + test_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_301); + } test_setopt(curl, CURLOPT_CUSTOMREQUEST, "IGLOO"); if((testno == 1574) || (testno == 1575)) {