mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
HttpClient getHeader can return empty string
Fixes #11999 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
68b478ea86
commit
08970aaee2
1 changed files with 7 additions and 1 deletions
|
|
@ -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 a new issue