Merge pull request #13418 from nextcloud/fix/11999/headers_can_be_empty

HttpClient getHeader can return empty string
pull/13429/head
Roeland Jago Douma 8 years ago committed by GitHub
commit b35db6c784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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