@@ -52,9 +52,7 @@ public function __construct(RequestInterface $request, ResponseInterface $respon
5252 $ this ->options = $ options ;
5353 $ this ->curl = curl_init ();
5454
55- if (is_array ($ this ->options ->curl_options )){
56- curl_setopt_array ($ this ->curl , $ this ->options ->curl_options );
57- }
55+ curl_setopt_array ($ this ->curl , $ this ->options ->curl_options );
5856 }
5957
6058 /**
@@ -118,8 +116,8 @@ public function init(){
118116 CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS ,
119117 CURLOPT_SSL_VERIFYPEER => true ,
120118 CURLOPT_SSL_VERIFYHOST => 2 ,
121- CURLOPT_CAINFO => is_file ( $ this ->options ->ca_info ) ? $ this -> options -> ca_info : null ,
122- CURLOPT_TIMEOUT => ( int ) $ this -> options -> timeout ,
119+ CURLOPT_CAINFO => $ this ->options ->ca_info ,
120+ CURLOPT_TIMEOUT => 10 ,
123121 CURLOPT_CONNECTTIMEOUT => 30 ,
124122 CURLOPT_WRITEFUNCTION => [$ this , 'writefunction ' ],
125123 CURLOPT_HEADERFUNCTION => [$ this , 'headerfunction ' ],
@@ -223,7 +221,9 @@ public function init(){
223221 $ options [CURLOPT_HTTPHEADER ][] = 'Content-Type: ' ;
224222 }
225223
226- curl_setopt_array ($ this ->curl , $ this ->options ->curl_options + $ options );
224+ // overwrite the default values with $curl_options
225+ // @todo: callback/middleware for the cURL options array?
226+ curl_setopt_array ($ this ->curl , $ options + $ this ->options ->curl_options );
227227
228228 return $ this ->curl ;
229229 }
0 commit comments