Certain servers may not set a whitespace after a colon (Set-Cookie: header) #3699

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

vmattila commented Feb 7, 2013

If there is no whitespace after a colon, PHP Notice Undefined offset: 1 in \Zend\Http\Header\SetCookie.php:135 is raised. This PR fixes also the issue zendframework#2946 .

Owner

weierophinney commented Feb 8, 2013

Can you add a test for this, please -- so that we don't introduce a regression later?

@vmattila vmattila * Added two incomplete, but valid "Set-Cookie:" and "Set-Cookie: " he…
…aders to the test dataprovider

* Modified behaviour of SetCookie::getFieldValue() in case of empty header
a6ee873
Contributor

vmattila commented Feb 8, 2013

Tests added. It seems that SetCookie::setFieldValue() does not survive from this kind of empty headers but throws an error. Fixed it too to return an empty string in such a case.

@weierophinney weierophinney added a commit that referenced this pull request Feb 8, 2013

@weierophinney weierophinney Merge branch 'hotfix/3699' into develop
Forward port #3699
78520fe

weierophinney was assigned Feb 8, 2013

Why we have to incomplete data sets? I one not enough?

I see this in the file and my first idea was "clean one of them... now!!!"

Contributor

vmattila replied Nov 25, 2013

These two "incomplete" cookie datasets are syntatically valid Set-Cookie headers and there just to avoid regression with another modification.

Contributor

ClemensSahs replied Nov 25, 2013

@vmattila
yes, I know that both a valid. My question was "will be one of them enough or not?"
In my mind dataprovider will call in front off test setup, with that behavior we will have tow similar tests.

...
oh sorry... I see now at the first time, that we have a whitespace after the second "Set-Cookie:"
this is my fail... yes so we have tow different test.

regards

@weierophinney weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge branch 'hotfix/3699' a65cb66

@weierophinney weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015

@weierophinney weierophinney Merge branch 'hotfix/3699' into develop f4ac757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment