Skip to content
Snippets Groups Projects
Unverified Commit 08970aae authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

HttpClient getHeader can return empty string


Fixes #11999

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent 68b478ea
No related branches found
No related tags found
No related merge requests found
......@@ -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];
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment