@@ -288,7 +288,7 @@ private function setUpDefaultRequestOptions(): void {
288288 $ this ->serverVersion ->method ('getVersionString ' )
289289 ->willReturn ('123.45.6 ' );
290290
291- $ acceptEnc = function_exists ( ' brotli_uncompress ' ) ? 'br, gzip ' : 'gzip ' ;
291+ $ acceptEnc = ((( curl_version ()[ ' features ' ] ?? 0 ) & CURL_VERSION_BROTLI ) === CURL_VERSION_BROTLI ) ? 'br, gzip ' : 'gzip ' ;
292292 $ this ->defaultRequestOptions = [
293293 'verify ' => '/my/path.crt ' ,
294294 'proxy ' => [
@@ -495,7 +495,7 @@ public function testSetDefaultOptionsWithNotInstalled(): void {
495495 $ this ->serverVersion ->method ('getVersionString ' )
496496 ->willReturn ('123.45.6 ' );
497497
498- $ acceptEnc = function_exists ( ' brotli_uncompress ' ) ? 'br, gzip ' : 'gzip ' ;
498+ $ acceptEnc = ((( curl_version ()[ ' features ' ] ?? 0 ) & CURL_VERSION_BROTLI ) === CURL_VERSION_BROTLI ) ? 'br, gzip ' : 'gzip ' ;
499499
500500 $ this ->assertEquals ([
501501 'verify ' => \OC ::$ SERVERROOT . '/resources/config/ca-bundle.crt ' ,
@@ -553,7 +553,7 @@ public function testSetDefaultOptionsWithProxy(): void {
553553 $ this ->serverVersion ->method ('getVersionString ' )
554554 ->willReturn ('123.45.6 ' );
555555
556- $ acceptEnc = function_exists ( ' brotli_uncompress ' ) ? 'br, gzip ' : 'gzip ' ;
556+ $ acceptEnc = ((( curl_version ()[ ' features ' ] ?? 0 ) & CURL_VERSION_BROTLI ) === CURL_VERSION_BROTLI ) ? 'br, gzip ' : 'gzip ' ;
557557
558558 $ this ->assertEquals ([
559559 'verify ' => '/my/path.crt ' ,
@@ -615,7 +615,7 @@ public function testSetDefaultOptionsWithProxyAndExclude(): void {
615615 $ this ->serverVersion ->method ('getVersionString ' )
616616 ->willReturn ('123.45.6 ' );
617617
618- $ acceptEnc = function_exists ( ' brotli_uncompress ' ) ? 'br, gzip ' : 'gzip ' ;
618+ $ acceptEnc = ((( curl_version ()[ ' features ' ] ?? 0 ) & CURL_VERSION_BROTLI ) === CURL_VERSION_BROTLI ) ? 'br, gzip ' : 'gzip ' ;
619619
620620 $ this ->assertEquals ([
621621 'verify ' => '/my/path.crt ' ,
@@ -680,11 +680,12 @@ public function testSetServerUrlInUserAgent(string $url, string $userAgent): voi
680680 $ this ->serverVersion ->method ('getVersionString ' )
681681 ->willReturn ('123.45.6 ' );
682682
683+ $ acceptEnc = (((curl_version ()['features ' ] ?? 0 ) & CURL_VERSION_BROTLI ) === CURL_VERSION_BROTLI ) ? 'br, gzip ' : 'gzip ' ;
683684 $ this ->assertEquals ([
684685 'verify ' => '/my/path.crt ' ,
685686 'headers ' => [
686687 'User-Agent ' => $ userAgent ,
687- 'Accept-Encoding ' => ' gzip ' ,
688+ 'Accept-Encoding ' => $ acceptEnc ,
688689 ],
689690 'timeout ' => 30 ,
690691 'nextcloud ' => [
0 commit comments