diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-01-07 22:08:32 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-01-08 14:14:59 +0100 |
commit | 08970aaee2d54b8eb0f69a3d62369e60a189a9f6 (patch) | |
tree | 25f4c87ce74cd086258717f6d150a80ffcd97509 /lib | |
parent | 68b478ea869fb953af6901bbb888a6f0c34f77c5 (diff) | |
download | nextcloud-server-08970aaee2d54b8eb0f69a3d62369e60a189a9f6.tar.gz nextcloud-server-08970aaee2d54b8eb0f69a3d62369e60a189a9f6.zip |
HttpClient getHeader can return empty string
Fixes #11999
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Http/Client/Response.php | 8 |
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]; } /** |