Add cookies to request object#175
Merged
WyriHaximus merged 3 commits intoreactphp:masterfrom May 10, 2017
Merged
Conversation
WyriHaximus
approved these changes
Apr 23, 2017
clue
reviewed
Apr 23, 2017
Member
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?
Contributor
Author
|
@clue you're right about the space between multiple cookies. Fixed it. |
clue
approved these changes
Apr 26, 2017
Member
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
3974e62
Compare
andig
reviewed
May 5, 2017
src/ServerRequest.php
Outdated
| */ | ||
| public static function parseCookie($cookie) | ||
| { | ||
| // PSR-7 `getHeadline('Cookies')` will return multiple |
andig
reviewed
May 5, 2017
src/ServerRequest.php
Outdated
| public static function parseCookie($cookie) | ||
| { | ||
| // PSR-7 `getHeadline('Cookies')` will return multiple | ||
| // cookie header coma-seperated. Multiple cookie headers |
andig
reviewed
May 5, 2017
tests/ServerTest.php
Outdated
| $this->assertEquals(array(), $requestValidation->getCookieParams()); | ||
| } | ||
|
|
||
| public function testCookieWithSepeartorWillBeAddedToServerRequest() |
Member
04f89d2 to
0a4e5e1
Compare
andig
reviewed
May 9, 2017
| { | ||
| // 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 |
Contributor
There was a problem hiding this comment.
Should imho read
... PSR-7 getHeaderLine('Cookie') will return multiple comma-seperated cookie headers.
jsor
approved these changes
May 10, 2017
Member
|
FYI Travis failure was unrelated to this PR and only on the HHVM job. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.