1
0
Fork 0

Revert "Fix IHTTPResult::getHeader/s() - Split functionality "getHeader()" and "getHeaders()" analog to IMessageInterface::getHeader/s() - Fix functionality at various places - Adapt CurlResultTest"

This reverts commit 933ea7c9
This commit is contained in:
Philipp Holzer 2020-10-11 23:26:03 +02:00
commit 069753416d
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
11 changed files with 28 additions and 96 deletions

View file

@ -242,29 +242,23 @@ class CurlResult implements IHTTPResult
}
/** {@inheritDoc} */
public function getHeader($header)
public function getHeader(string $field = '')
{
if (empty($header)) {
return '';
if (empty($field)) {
return $this->header;
}
$header = strtolower(trim($header));
$field = strtolower(trim($field));
$headers = $this->getHeaderArray();
if (isset($headers[$header])) {
return $headers[$header];
if (isset($headers[$field])) {
return $headers[$field];
}
return '';
}
/** {@inheritDoc} */
public function getHeaders()
{
return $this->getHeaderArray();
}
/** {@inheritDoc} */
public function inHeader(string $field)
{