summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Http/Client/Response.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Http/Client/Response.php b/lib/private/Http/Client/Response.php
index 73c14c2926d..6786ecd6fc1 100644
--- a/lib/private/Http/Client/Response.php
+++ b/lib/private/Http/Client/Response.php
@@ -71,7 +71,13 @@ class Response implements IResponse {
* @return string
*/
public function getHeader(string $key): string {
- return $this->response->getHeader($key)[0];
+ $headers = $this->response->getHeader($key);
+
+ if (count($headers) === 0) {
+ return '';
+ }
+
+ return $headers[0];
}
/**