Skip to content

Commit 3a6c284

Browse files
committed
HHVM compatibility
1 parent 1da7562 commit 3a6c284

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Github/Http/CurlClient.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ protected function process(Request $request)
6565
$hardOptions = [
6666
CURLOPT_FOLLOWLOCATION => FALSE, # Github sets the Location header for 201 code too and redirection is not required for us
6767
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
68-
CURLOPT_PROTOCOLS => CURLPROTO_HTTP | CURLPROTO_HTTPS,
6968
CURLOPT_CUSTOMREQUEST => $request->getMethod(),
7069
CURLOPT_NOBODY => $request->isMethod(Request::HEAD),
7170
CURLOPT_URL => $request->getUrl(),
@@ -88,6 +87,10 @@ protected function process(Request $request)
8887
},
8988
];
9089

90+
if (defined('CURLOPT_PROTOCOLS')) { # HHVM issue. Even cURL v7.26.0, constants are missing.
91+
$hardOptions[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
92+
}
93+
9194
if (!$this->curl) {
9295
$this->curl = curl_init();
9396
if ($this->curl === FALSE) {

0 commit comments

Comments
 (0)