Throw "invalid cookie domain" as its definition implies#1955
Throw "invalid cookie domain" as its definition implies#1955whimboo merged 2 commits intow3c:masterfrom
Conversation
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Improve the error reporting for [cookie addition](https://w3c.github.io/webdriver/#add-cookie). Most notably, when - expiry time exceeds maximum safe integer - cookie domain is not equal to session's current browsing context's active document's domain There is a bug with spec: #43690 (comment). We fix spec in w3c/webdriver#1955 and make sure Servo behaves consistently with other browsers. Testing: Added one test for invalid expiry time. New passing with existing. --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
|
This makes sense. Thanks for discovering that discrepancy. The referenced tests can be found here but I have to add that we only test unsupported schemes for |
|
Adding one more in web-platform-tests/wpt#58801 |
There was a problem hiding this comment.
Would you mind to move this second block up before the invalid cookie domain one so that we have the type checks for the cookie data together? In the moment the browsing context check separates them.
This will also fix the issue that we should fail with invalid argument when the cookie domain is invalid. We should only see invalid cookie domain if the type check for cookie domain succeeded but the actual domain is incorrect.
This is what browsers actually should do these days as well and we actually miss all those invalid test cases for this command. :/ But to add those is not a blocker for this PR to get merged.
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
|
whimboo marked as non substantive for IPR from ash-nazg. |
|
@yezhizhen given that you contributed a lot already please try to join the W3C group if possible so that the IP check wouldn't cause us trouble. |
SHA: 370aeff Reason: push, by whimboo Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 370aeff Reason: push, by pull[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 370aeff Reason: push, by pull[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I just joined! |
See servo/servo#43690 (comment)
The definition of InvalidCookieDomain is: An illegal attempt was made to set a cookie under a different domain than the current page.
But somehow, the spec asks to throw "invalid argument" error for this case.
However, all browsers indeed throw "invalid cookie domain" for this case.
Following test aligns with current spec, yet fails for all browsers.
This change is
Preview | Diff