From a3312a0ecd07f885f5dce307504205a6fad8bfb9 Mon Sep 17 00:00:00 2001 From: Ahmad Nassri Date: Fri, 11 Dec 2015 18:38:09 -0500 Subject: [PATCH] allow to override curlopts --- src/Unirest/Request.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Unirest/Request.php b/src/Unirest/Request.php index e5dd4ab..44e3df9 100755 --- a/src/Unirest/Request.php +++ b/src/Unirest/Request.php @@ -387,9 +387,6 @@ class Request { self::$handle = curl_init(); - // start with default options - curl_setopt_array(self::$handle, self::$curlOpts); - if ($method !== Method::GET) { curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method); @@ -421,6 +418,9 @@ class Request // If an empty string, '', is set, a header containing all supported encoding types is sent CURLOPT_ENCODING => '' )); + + // update options + curl_setopt_array(self::$handle, self::$curlOpts); if (self::$socketTimeout !== null) { curl_setopt(self::$handle, CURLOPT_TIMEOUT, self::$socketTimeout);