@@ -52,9 +52,7 @@ public function __construct(RequestInterface $request, ResponseInterface $respon
52
52
$ this ->options = $ options ;
53
53
$ this ->curl = curl_init ();
54
54
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 );
58
56
}
59
57
60
58
/**
@@ -118,8 +116,8 @@ public function init(){
118
116
CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS ,
119
117
CURLOPT_SSL_VERIFYPEER => true ,
120
118
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 ,
123
121
CURLOPT_CONNECTTIMEOUT => 30 ,
124
122
CURLOPT_WRITEFUNCTION => [$ this , 'writefunction ' ],
125
123
CURLOPT_HEADERFUNCTION => [$ this , 'headerfunction ' ],
@@ -223,7 +221,9 @@ public function init(){
223
221
$ options [CURLOPT_HTTPHEADER ][] = 'Content-Type: ' ;
224
222
}
225
223
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 );
227
227
228
228
return $ this ->curl ;
229
229
}
0 commit comments