Fix bug #68083 PUT method not working after DELETE
authorMichael Wallner <mike@php.net>
Thu, 25 Sep 2014 07:17:42 +0000 (09:17 +0200)
committerMichael Wallner <mike@php.net>
Thu, 25 Sep 2014 07:17:42 +0000 (09:17 +0200)
properly reset curl's request method bits

php_http_client_curl.c

index 5c1fecd9b5a52798818569cdf23c3f935fe28050..6f9884ef87feff5eb4be102157f274c2b46f9c7e 100644 (file)
@@ -1496,6 +1496,9 @@ static STATUS php_http_client_curl_handler_reset(php_http_client_curl_handler_t
        }
 
        curl_easy_setopt(ch, CURLOPT_URL, NULL);
+       curl_easy_setopt(ch, CURLOPT_CUSTOMREQUEST, NULL);
+       curl_easy_setopt(ch, CURLOPT_HTTPGET, 1L);
+       curl_easy_setopt(ch, CURLOPT_NOBODY, 0L);
        /* libcurl < 7.19.6 does not clear auth info with USERPWD set to NULL */
 #if PHP_HTTP_CURL_VERSION(7,19,1)
        curl_easy_setopt(ch, CURLOPT_PROXYUSERNAME, NULL);