Without request body there's no point in asking for 100-continue.
Bug: http://curl.haxx.se/bug/view.cgi?id=1349
Reported-by: JimS
return result;
}
- result = expect100(data, conn, req_buffer);
- if(result)
- return result;
+ if(postsize != 0) {
+ result = expect100(data, conn, req_buffer);
+ if(result)
+ return result;
+ }
result = Curl_add_buffer(req_buffer, "\r\n", 2); /* end of headers */
if(result)
test1396 test1397 \
\
test1400 test1401 test1402 test1403 test1404 test1405 test1406 test1407 \
-test1408 test1409 test1410 test1412 test1413 test1414 test1415 \
+test1408 test1409 test1410 test1411 test1412 test1413 test1414 test1415 \
test1416 test1417 test1418 test1419 \
\
test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \
Accept: */*\r
Proxy-Connection: Keep-Alive\r
Content-Length: 0\r
-Expect: 100-continue\r
\r
GET http://%HOSTIP:%HTTPPORT/1001 HTTP/1.1\r
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1001", response="6af4d89c952f4dd4cc215a6878dc499d"\r
Accept: */*\r
Proxy-Connection: Keep-Alive\r
Content-Length: 0\r
-Expect: 100-continue\r
\r
GET http://%HOSTIP:%HTTPPORT/1002.upload1 HTTP/1.1\r
Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/1002.upload1", response="198aa9b6acb4b0c71d02a197a5e41f54"\r
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+PUT
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 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
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+
+# make sure there's no Expect: 100-continue when there's no file to send!
+ <name>
+HTTP with zero size file PUT
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1411 -T log/empty1411
+</command>
+# create an empty file
+<file name="log/empty1411">
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1411 HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+Content-Length: 0\r
+\r
+</protocol>
+</verify>
+</testcase>
Host: %HOSTIP:%HTTPPORT\r
Accept: */*\r
Content-Length: 0\r
-Expect: 100-continue\r
\r
PUT /155 HTTP/1.1\r
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAACeAJ4AWAAAAAAAAAD2AAAACAAIAPYAAAAIAAgA/gAAAAAAAAAAAAAABoKBAFuu0VIvKeMdPwjDPk7eAnwxMjM0NTY3OC1uDhL9DbZXt27JqdXMDkABAQAAAAAAAACAPtXesZ0BMTIzNDU2NzgAAAAAAgAEAEMAQwABABIARQBMAEkAUwBBAEIARQBUAEgABAAYAGMAYwAuAGkAYwBlAGQAZQB2AC4AbgB1AAMALABlAGwAaQBzAGEAYgBlAHQAaAAuAGMAYwAuAGkAYwBlAGQAZQB2AC4AbgB1AAAAAAAAAAAAdGVzdHVzZXJjdXJsaG9zdA==\r
Host: %HOSTIP:%HTTPPORT\r
Accept: */*\r
Content-Length: 0\r
-Expect: 100-continue\r
\r
PUT /88 HTTP/1.1\r
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/88", response="78a49fa53d0c228778297687d4168e71"\r