diff --git a/app/Services/DavClient/Utils/AddressBookGetter.php b/app/Services/DavClient/Utils/AddressBookGetter.php index 5f9f2dae8b4..5137746c7ec 100644 --- a/app/Services/DavClient/Utils/AddressBookGetter.php +++ b/app/Services/DavClient/Utils/AddressBookGetter.php @@ -116,12 +116,6 @@ private function getAddressBookBaseUri(): string private function checkOptions() { $options = $this->client->options(); - if (! empty($options)) { - $options = array_map(function ($option) { - return explode(', ', $option); - }, $options); - $options = Arr::flatten($options); - } if (! in_array('1', $options) || ! in_array('3', $options) || ! in_array('addressbook', $options)) { throw new DavServerNotCompliantException('server is not compliant with rfc2518 section 15.1, or rfc6352 section 6.1'); diff --git a/app/Services/DavClient/Utils/Dav/DavClient.php b/app/Services/DavClient/Utils/Dav/DavClient.php index 8e70254a28f..481755c6c60 100644 --- a/app/Services/DavClient/Utils/Dav/DavClient.php +++ b/app/Services/DavClient/Utils/Dav/DavClient.php @@ -483,16 +483,15 @@ public function options(): array { $response = $this->request('OPTIONS'); - $dav = Arr::get($response->headers(), 'Dav'); - if (! $dav) { + $dav = $response->header('Dav'); + if (empty($dav)) { return []; } + $davs = explode(', ', $dav); - foreach ($dav as &$v) { - $v = trim($v); - } - - return $dav; + return array_map(function ($header) { + return trim($header); + }, $davs); } /**