summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-01-07 22:08:32 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-01-08 14:14:59 +0100
commit08970aaee2d54b8eb0f69a3d62369e60a189a9f6 (patch)
tree25f4c87ce74cd086258717f6d150a80ffcd97509 /lib
parent68b478ea869fb953af6901bbb888a6f0c34f77c5 (diff)
downloadnextcloud-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.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];
}
/**