Browse Source
HttpClient getHeader can return empty string
Fixes #11999
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v16.0.0alpha1
Roeland Jago Douma
5 years ago
No account linked to committer's email address
|
|
@@ -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]; |
|
|
|
} |
|
|
|
|
|
|
|
/** |