mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
style(http-client): use explicit bitmask comparison for CURL_VERSION_BROTLI
Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
This commit is contained in:
parent
35dd600e47
commit
78cb8c3de5
2 changed files with 5 additions and 5 deletions
|
|
@ -94,7 +94,7 @@ class Client implements IClient {
|
|||
$headers = $options[RequestOptions::HEADERS] ?? [];
|
||||
if (!isset($headers['Accept-Encoding'])) {
|
||||
$acceptEnc = 'gzip';
|
||||
if ((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) {
|
||||
if (((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) === CURL_VERSION_BROTLI) {
|
||||
$acceptEnc = 'br, ' . $acceptEnc;
|
||||
}
|
||||
$options[RequestOptions::HEADERS] = $headers; // ensure headers are present
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ class ClientTest extends \Test\TestCase {
|
|||
$this->serverVersion->method('getVersionString')
|
||||
->willReturn('123.45.6');
|
||||
|
||||
$acceptEnc = ((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
$acceptEnc = (((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) === CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
$this->defaultRequestOptions = [
|
||||
'verify' => '/my/path.crt',
|
||||
'proxy' => [
|
||||
|
|
@ -488,7 +488,7 @@ class ClientTest extends \Test\TestCase {
|
|||
$this->serverVersion->method('getVersionString')
|
||||
->willReturn('123.45.6');
|
||||
|
||||
$acceptEnc = ((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
$acceptEnc = (((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) === CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
|
||||
$this->assertEquals([
|
||||
'verify' => \OC::$SERVERROOT . '/resources/config/ca-bundle.crt',
|
||||
|
|
@ -544,7 +544,7 @@ class ClientTest extends \Test\TestCase {
|
|||
$this->serverVersion->method('getVersionString')
|
||||
->willReturn('123.45.6');
|
||||
|
||||
$acceptEnc = ((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
$acceptEnc = (((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) === CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
|
||||
$this->assertEquals([
|
||||
'verify' => '/my/path.crt',
|
||||
|
|
@ -604,7 +604,7 @@ class ClientTest extends \Test\TestCase {
|
|||
$this->serverVersion->method('getVersionString')
|
||||
->willReturn('123.45.6');
|
||||
|
||||
$acceptEnc = ((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
$acceptEnc = (((curl_version()['features'] ?? 0) & CURL_VERSION_BROTLI) === CURL_VERSION_BROTLI) ? 'br, gzip' : 'gzip';
|
||||
|
||||
$this->assertEquals([
|
||||
'verify' => '/my/path.crt',
|
||||
|
|
|
|||
Loading…
Reference in a new issue