HttpClient getHeader can return empty string

Fixes #11999

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/13418/head
Roeland Jago Douma 8 years ago
parent 68b478ea86
commit 08970aaee2
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 8
      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];
}
/**

Loading…
Cancel
Save