Uh oh!
There was an error while loading. Please reload this page.
Add cookies to request object - #175
Conversation
clue
left a comment
There was a problem hiding this comment.
Nice!
The RFC suggests that there must be a space between multiple cookie-pairs, such as Cookie: SID=31d4d96e407aad42; lang=en-US. Can you verify https://tools.ietf.org/html/rfc6265#section-4.2.1?
Uh oh!
There was an error while loading. Please reload this page.
legionth
commented
Apr 24, 2017
@clue you're right about the space between multiple cookies. Fixed it. |
clue
left a comment
There was a problem hiding this comment.
Changes LGTM, thanks! 👍
The RFC suggests there MUST be space after the semicolon, are clients that omit this space relevant? May I ask you to check how other parsers handle this situation? 👍
d736267 to
3974e62Compare| */ | ||
| public static function parseCookie($cookie) | ||
| { | ||
| // PSR-7 `getHeadline('Cookies')` will return multiple |
| public static function parseCookie($cookie) | ||
| { | ||
| // PSR-7 `getHeadline('Cookies')` will return multiple | ||
| // cookie header coma-seperated. Multiple cookie headers |
| $this->assertEquals(array(), $requestValidation->getCookieParams()); | ||
| } | ||
| public function testCookieWithSepeartorWillBeAddedToServerRequest() |
WyriHaximus
commented
May 8, 2017
04f89d2 to
0a4e5e1Compare| { | ||
| // PSR-7 `getHeaderLine('Cookies')` will return multiple | ||
| // cookie header comma-seperated. Multiple cookie headers | ||
| // are not allowed according to https://tools.ietf.org/html/rfc6265#section-5.4 |
There was a problem hiding this comment.
Should imho read
... PSR-7 getHeaderLine('Cookie') will return multiple comma-seperated cookie headers.
WyriHaximus
commented
May 10, 2017
FYI Travis failure was unrelated to this PR and only on the HHVM job. |
This PR adds cookies to the PSR-7 ServerRequest. The implementation of cookies is line with the implementation of PHP.
I added a simple example to this to test this via a web browser.