Merge pull request #13418 from nextcloud/fix/11999/headers_can_be_empty
HttpClient getHeader can return empty string
This commit is contained in:
commit
b35db6c784
|
@ -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…
Reference in New Issue