ensure options are applied before the headers are set
authorMichael Wallner <mike@php.net>
Thu, 5 Feb 2015 15:26:19 +0000 (16:26 +0100)
committerMichael Wallner <mike@php.net>
Thu, 5 Feb 2015 15:26:19 +0000 (16:26 +0100)
php_http_client_curl.c

index 8aaeaa069019b6936408d54d8bad95ff465e07e2..e92834dd98f0936733b8d92804d2902ad08bc425 100644 (file)
@@ -1743,6 +1743,9 @@ static STATUS php_http_client_curl_handler_prepare(php_http_client_curl_handler_
                }
        }
 
+       /* apply options */
+       php_http_options_apply(&php_http_curle_options, enqueue->options, curl);
+
        /* request headers */
        php_http_message_update_headers(msg);
        if (zend_hash_num_elements(&msg->hdrs)) {
@@ -1798,8 +1801,6 @@ static STATUS php_http_client_curl_handler_prepare(php_http_client_curl_handler_
                curl_easy_setopt(curl->handle, CURLOPT_POSTFIELDSIZE, 0L);
        }
 
-       php_http_options_apply(&php_http_curle_options, enqueue->options, curl);
-
        return SUCCESS;
 }