@@ -28,7 +28,7 @@ class Curl
28
28
protected $ strict_mode = false ;
29
29
protected $ max_redirects = 10 ;
30
30
31
- protected $ http_version = NULL ;
31
+ protected $ http_version = CURL_HTTP_VERSION_1_1 ;
32
32
protected $ http_versions = array (
33
33
'1.0 ' => CURL_HTTP_VERSION_1_0 ,
34
34
'1.1 ' => CURL_HTTP_VERSION_1_1
@@ -310,7 +310,7 @@ public function execute($url = '') {
310
310
}
311
311
312
312
(isset ($ this ->options [CURLOPT_HTTPHEADER ]) or empty ($ this ->headers )) or $ this ->options [CURLOPT_HTTPHEADER ] = $ this ->headers ;
313
- (isset ($ this ->options [CURLOPT_HTTP_VERSION ])or empty ( $ this -> http_version ) ) or $ this ->options [CURLOPT_HTTP_VERSION ] = $ this ->http_version ;
313
+ (isset ($ this ->options [CURLOPT_HTTP_VERSION ])) or $ this ->options [CURLOPT_HTTP_VERSION ] = $ this ->http_version ;
314
314
isset ($ this ->options [CURLOPT_USERAGENT ]) or $ this ->options [CURLOPT_USERAGENT ] = self ::USER_AGENT ;
315
315
316
316
if ($ this ->request = curl_init ($ this ->url ) and is_resource ($ this ->request )) {
@@ -335,7 +335,7 @@ public function execute($url = '') {
335
335
$ headers = substr ($ response , 0 , $ this ->info ['header_size ' ]);
336
336
$ body = substr ($ response , $ this ->info ['header_size ' ]);
337
337
338
- return new CurlResponse ($ response , $ headers , $ body , $ this ->info ['http_code ' ]);
338
+ return new CurlResponse ($ response , $ headers , $ body , $ this ->info ['http_code ' ], array_search ( $ this -> http_version , $ this -> http_versions ) );
339
339
}
340
340
} else {
341
341
$ this ->clear ();
0 commit comments