This repository was archived by the owner on Jan 30, 2020. It is now read-only.
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Headers invalid argument in addHeaderLine method #116
Closed
Description
Headers failing by sending empty "user-agent"
The main issue in Headers::addHeaders
if (is_string($value)) {
$this->addHeaderLine($value);
But below in method addHeaderLine signature
public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null)
{
$matches = null;
if (preg_match('/^(?P<name>[^()><@,;:\"\\/\[\]?=}{ \t]+):.*$/', $headerFieldNameOrLine, $matches)
&& $fieldValue === null) {
// is a header
$headerName = $matches['name'];
$headerKey = static::createKey($matches['name']);
$line = $headerFieldNameOrLine;
} elseif ($fieldValue === null) {
throw new Exception\InvalidArgumentException('A field name was provided without a field value');
}
Witch is wrong typing NULL on string only fields
Metadata
Metadata
Assignees
Labels
No labels