Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Conversation

@necromant2005
Copy link

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

@Xerkus Xerkus added the invalid label Mar 9, 2017
@Xerkus
Copy link
Member

Xerkus commented Mar 9, 2017

As noted in #116 no value headers are invalid

@Xerkus Xerkus closed this Mar 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants