Skip to content

Commit

Permalink
Merge pull request #86 from Mashape/curlopts-override-fix
Browse files Browse the repository at this point in the history
allow to override curlopts
  • Loading branch information
Ahmad Nassri committed Dec 11, 2015
2 parents fde6f41 + a3312a0 commit e11c54d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Unirest/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ public static function send($method, $url, $body = null, $headers = array(), $us
{
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);

Expand Down Expand Up @@ -421,6 +418,9 @@ public static function send($method, $url, $body = null, $headers = array(), $us
// 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);
Expand Down

0 comments on commit e11c54d

Please sign in to comment.