-
Notifications
You must be signed in to change notification settings - Fork 86
Headers invalid argument in addHeaderLine method #116
Comments
Headers without value are invalid. What is trying to send empty user-agent? |
I'm unclear what you expect to occur. If the idea is to unset the header, you would need to use: if ($headers->has($header)) {
$headers->removeHeader($headers->get($name));
} If the idea is to set an empty value, as @Xerkus notes, that's invalid per the HTTP specifications. You could do something like this: $headers->addHeaderLine($header, ''); Both of the above would require that you validate the value being provided before you try and create the header, which is likely a good idea anyways. We do not intend to support the usage
Neither feels like a valid option. |
I'm getting error on production because some bots comes with empty "user-agent" headers
You're right, there shouldn't be requests with empty value, but they are. It's incorrect zf behaviour to fail on every request, I'm expecting something simpler - "skip it and move forward" |
@weierophinney may be he is on to something here, it is actually zend-mvc related issue, exception in request factory will result in uncaught exception and error log entry while it should be normal abort with |
Headers failing by sending empty "user-agent"
The main issue in Headers::addHeaders
But below in method addHeaderLine signature
Witch is wrong typing NULL on string only fields
The text was updated successfully, but these errors were encountered: