-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Zend\Http\Header\SetCookie changed to support empty cookies #5476
Conversation
$keyValue is receiving value with '=' when the cookie is empty. Issue #5475
Please add a unit test too |
I write some tests for this problem, I'm sorry to say this patch is not working. currently I'm try to fix this in every case its possible all following case we must detect correctly array(
'Set-Cookie: emptykey= ; Domain=docs.foo.com;', // current failing
'Set-Cookie: emptykey=; Domain=docs.foo.com;',
'Set-Cookie: emptykey; Domain=docs.foo.com;'
); is there a some other one? |
currently your patch run at this CI-Job |
In my mind a fix in the else branch is only a workaround, we have the if branch to cover all keyValuePairs:
the else branch will be for tags like "httponly" or "secure" what is your opinion? |
I agree with you. I had not realized it. The current regex have a plus sign to match headerValue '#^(?P[^=]+)=\s*("?)(?P[^"]+)\2#' I'll revert the past changes and change the regex to '#^(?P[^=]+)=\s_("?)(?P[^"]_)\2#' |
@Maks3w |
Any word on this getting merged? For what it's worth, I had a similar problem, and this appears to have fixed it. |
Zend\Http\Header\SetCookie changed to support empty cookies
I suppose it is fine for parsing needs that this particular class be a bit more liberal than the spec. But for the record, I don't see anywhere in the cookie spec that says values can be empty: https://www.ietf.org/rfc/rfc2109.txt |
@ralphschindler |
…uine/patch-1 Zend\Http\Header\SetCookie changed to support empty cookies
$keyValue is receiving value with '=' when the cookie is empty.
Issue #5475