- avoid "Content-Length: 0" header on custom requests
authorMichael Wallner <mike@php.net>
Sat, 7 Jan 2006 17:41:48 +0000 (17:41 +0000)
committerMichael Wallner <mike@php.net>
Sat, 7 Jan 2006 17:41:48 +0000 (17:41 +0000)
http_request_api.c

index 84acf1c37b7eb97ac8781e459f82ccc55e2af534..082c5fc768bece975c572a8a28031a97954a244b 100644 (file)
@@ -629,22 +629,38 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti
        switch (request->meth)
        {
                case HTTP_GET:
+                       HTTP_CURL_OPT(NOBODY, 0);
+                       HTTP_CURL_OPT(POST, 0);
+                       HTTP_CURL_OPT(UPLOAD, 0);
                        HTTP_CURL_OPT(HTTPGET, 1);
                break;
 
                case HTTP_HEAD:
+                       HTTP_CURL_OPT(POST, 0);
+                       HTTP_CURL_OPT(UPLOAD, 0);
+                       HTTP_CURL_OPT(HTTPGET, 0);
                        HTTP_CURL_OPT(NOBODY, 1);
                break;
 
                case HTTP_POST:
+                       HTTP_CURL_OPT(UPLOAD, 0);
+                       HTTP_CURL_OPT(HTTPGET, 0);
+                       HTTP_CURL_OPT(NOBODY, 0);
                        HTTP_CURL_OPT(POST, 1);
                break;
 
                case HTTP_PUT:
+                       HTTP_CURL_OPT(HTTPGET, 0);
+                       HTTP_CURL_OPT(NOBODY, 0);
+                       HTTP_CURL_OPT(POST, 0);
                        HTTP_CURL_OPT(UPLOAD, 1);
                break;
 
                default:
+                       HTTP_CURL_OPT(HTTPGET, 0);
+                       HTTP_CURL_OPT(NOBODY, 0);
+                       HTTP_CURL_OPT(POST, 0);
+                       HTTP_CURL_OPT(UPLOAD, 0);
                        if (http_request_method_exists(0, request->meth, NULL)) {
                                HTTP_CURL_OPT(CUSTOMREQUEST, http_request_method_name(request->meth));
                        } else {