From ea055407fa45c4247042e7370d463364f03c3136 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 6 Feb 2012 22:59:49 +0100 Subject: curl_easy_reset: reset the referer string When CURLOPT_REFERER has been used, curl_easy_reset() did not properly clear it. Verified with the new test 598 Bug: http://curl.haxx.se/bug/view.cgi?id=3481551 Reported by: Michael Day --- tests/data/test598 | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tests/data/test598 (limited to 'tests/data/test598') diff --git a/tests/data/test598 b/tests/data/test598 new file mode 100644 index 000000000..123bbc37b --- /dev/null +++ b/tests/data/test598 @@ -0,0 +1,78 @@ + + + +HTTP +HTTP GET +CURLOPT_REFERER +curl_easy_reset + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + +-foo- + + +# since the request runs twice + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + +-foo- +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Length: 6 +Connection: close +Content-Type: text/html + +-foo- + + + + +# Client-side + + +http + +# tool is what to use instead of 'curl' + +lib598 + + + +curl_easy_reset with referer and other strings set + + +http://%HOSTIP:%HTTPPORT/598 + + + +# +# Verify data after the test has been "shot" + + +GET /598 HTTP/1.1 +User-Agent: the-moo agent next generation +Host: %HOSTIP:%HTTPPORT +Accept: */* +Referer: http://example.com/the-moo +Cookie: name=moo + +GET /598 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + -- cgit v1.2.3