Skip to content

Commit

Permalink
Merge pull request #219 from qibinghua/master
Browse files Browse the repository at this point in the history
CURLOPT_HTTPHEADER在php7接受空数组导致php-fpm奔溃
  • Loading branch information
rmccue authored Sep 18, 2016
2 parents ea359d3 + 65bab3f commit d4af2ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/Requests/Transport/cURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,9 @@ protected function setup_handle($url, $headers, $data, $options) {
curl_setopt($this->handle, CURLOPT_URL, $url);
curl_setopt($this->handle, CURLOPT_REFERER, $url);
curl_setopt($this->handle, CURLOPT_USERAGENT, $options['useragent']);
curl_setopt($this->handle, CURLOPT_HTTPHEADER, $headers);

if (!empty($headers)) {
curl_setopt($this->handle, CURLOPT_HTTPHEADER, $headers);
}
if ($options['protocol_version'] === 1.1) {
curl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
}
Expand Down

0 comments on commit d4af2ea

Please sign in to comment.