Skip to content

Commit e11c54d

Browse files
author
Ahmad Nassri
committed
Merge pull request #86 from Mashape/curlopts-override-fix
allow to override curlopts
2 parents fde6f41 + a3312a0 commit e11c54d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Unirest/Request.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,6 @@ public static function send($method, $url, $body = null, $headers = array(), $us
387387
{
388388
self::$handle = curl_init();
389389

390-
// start with default options
391-
curl_setopt_array(self::$handle, self::$curlOpts);
392-
393390
if ($method !== Method::GET) {
394391
curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method);
395392

@@ -421,6 +418,9 @@ public static function send($method, $url, $body = null, $headers = array(), $us
421418
// If an empty string, '', is set, a header containing all supported encoding types is sent
422419
CURLOPT_ENCODING => ''
423420
));
421+
422+
// update options
423+
curl_setopt_array(self::$handle, self::$curlOpts);
424424

425425
if (self::$socketTimeout !== null) {
426426
curl_setopt(self::$handle, CURLOPT_TIMEOUT, self::$socketTimeout);

0 commit comments

Comments
 (0)