Skip to content
This repository was archived by the owner on Apr 1, 2019. It is now read-only.

AddCookieParameters expiry should accept a date#29

Merged
jgraham merged 1 commit intomozilla:masterfrom
dlrobertson:expiry
Apr 27, 2016
Merged

AddCookieParameters expiry should accept a date#29
jgraham merged 1 commit intomozilla:masterfrom
dlrobertson:expiry

Conversation

@dlrobertson
Copy link

Modify the parsing and storage of AddCookieParameters expiry field to accept a given date.


This change is Reviewable

@dlrobertson
Copy link
Author

Just a few small changes that will help in implementing the commands related to cookies for servo.


Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions.


src/command.rs, line 773 [r1] (raw file):
Parse the time given. This is very similar to the method cookie-rs uses.


src/command.rs, line 779 [r1] (raw file):
small typo


src/command.rs, line 787 [r1] (raw file):
I don't know if this is the right way forward, but the max-age should be the time from now that the cookie has to live, right? Should we set this here or rely on the implementer to do this.


src/command.rs, line 896 [r1] (raw file):
Add basic tests


src/response.rs, line 100 [r1] (raw file):
I changed this so that we could store the Timespec::sec derectly without any as. I'm open to changing this. Is there any way we could change Date to pub struct Date(pub i64)?


Comments from Reviewable

@jgraham
Copy link
Member

jgraham commented Apr 25, 2016

Unfortunately I don't think this matches the spec. The from_json methods are supposed to deserialize from the webdriver wire protocol, so it's necessary to ensure that changes here correspond to that.


Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions.


src/command.rs, line 773 [r1] (raw file):
My comment was wrong, or at least outdated. The wire protocol only supports supplying the cookie expiry as an unix timestamp.


src/command.rs, line 779 [r1] (raw file):
It seems that the spec has also chosen not to support specifying max-age at all now, so this should all be removed.


src/command.rs, line 896 [r1] (raw file):
I would much prefer you to write some webdriver protocol tests in web-platform-tests so that they can be shared amongst multiple implementations.


src/response.rs, line 100 [r1] (raw file):
What did you change here?


Comments from Reviewable

@dlrobertson
Copy link
Author

After looking at it again, you're right. It looks as if max-age isn't used anymore.


Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions.


src/command.rs, line 773 [r1] (raw file):
Ah! I see. I was looking at RFC 6265, but after seeing https://w3c.github.io/webdriver/webdriver-spec.html#dfn-table-for-cookie-conversion


src/command.rs, line 779 [r1] (raw file):
Yeah, after looking at the table, you're right


src/command.rs, line 896 [r1] (raw file):
Good point.


src/response.rs, line 100 [r1] (raw file):
I changed my mind. See the prior revision


Comments from Reviewable

The spec no longer lists max-age. Therefore it should be removed from
the cookie response and AddCookieParameters.
@dlrobertson
Copy link
Author

I changed the commit to merely remove max-age from AddCookieParameters and the Cookie response to follow the table for cookie conversion. Please let me know if you have any questions. Feel free to close this PR if you would rather accomplish this a different way.

@jgraham
Copy link
Member

jgraham commented Apr 27, 2016

Reviewed 2 of 4 files at r3.
Review status: all files reviewed at latest revision, all discussions resolved.


src/command.rs, line 787 [r1] (raw file):
Rely on the implementor I think.


Comments from Reviewable

@jgraham jgraham merged commit 86372d8 into mozilla:master Apr 27, 2016
@jgraham
Copy link
Member

jgraham commented Apr 27, 2016

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants