{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/92676301","pull_request_review_id":13190832,"id":92676301,"diff_hunk":"@@ -133,23 +133,67 @@ fn test_sort_order() {\n     assert!(CookieStorage::cookie_comparator(&a, &a) == Ordering::Equal);\n }\n \n+fn add_cookie_to_storage(storage: &mut CookieStorage, url: &ServoUrl, cookie_str: &str)\n+{\n+    let source = CookieSource::HTTP(url.clone());\n+    let cookie = Cookie::new_wrapped(cookie_rs::Cookie::parse(cookie_str).unwrap(), url, source.clone()).unwrap();\n+    storage.push(cookie, source.clone());\n+}\n+\n+#[test]\n+fn test_insecure_cookies_cannot_evict_secure_cookie() {\n+    let mut storage = CookieStorage::new(5);\n+    let url = ServoUrl::parse(\"https://home.example.org:8888/cookie-parser?0001\").unwrap();\n+    let source = CookieSource::HTTP(url.clone());\n+    let mut cookies = Vec::new();\n+\n+    cookies.push(cookie_rs::Cookie::parse(\"foo=bar; Secure; Domain=home.example.org\").unwrap());\n+    cookies.push(cookie_rs::Cookie::parse(\"foo2=bar; Secure; Domain=.example.org\").unwrap());\n+    cookies.push(cookie_rs::Cookie::parse(\"foo3=bar; Secure; Path=/foo\").unwrap());\n+    cookies.push(cookie_rs::Cookie::parse(\"foo4=bar; Secure; Path=/foo/bar\").unwrap());\n+\n+    for bare_cookie in cookies {\n+        let cookie = Cookie::new_wrapped(bare_cookie, &url, source.clone()).unwrap();\n+        storage.push(cookie, source.clone());\n+    }\n+\n+    let url = ServoUrl::parse(\"http://home.example.org:8888/cookie-parser?0001\").unwrap();\n+\n+    add_cookie_to_storage(&mut storage, &url, \"foo=value; Domain=home.example.org\");\n+    add_cookie_to_storage(&mut storage, &url, \"foo2=value; Domain=.example.org\");\n+    add_cookie_to_storage(&mut storage, &url, \"foo3=value; Path=/foo/bar\");\n+    add_cookie_to_storage(&mut storage, &url, \"foo4=value; Path=/foo\");","path":"tests/unit/net/cookie.rs","position":92,"original_position":92,"commit_id":"5cc9952ff549cb133226f022d725881726d92dd6","original_commit_id":"5cc9952ff549cb133226f022d725881726d92dd6","user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"body":"We need another test that tries setting these cookies using a secure scheme, too.","created_at":"2016-12-15T19:00:28Z","updated_at":"2016-12-15T19:02:23Z","html_url":"https://github.com/servo/servo/pull/14491#discussion_r92676301","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/14491","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/92676301"},"html":{"href":"https://github.com/servo/servo/pull/14491#discussion_r92676301"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/14491"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/14491","id":97092002,"html_url":"https://github.com/servo/servo/pull/14491","diff_url":"https://github.com/servo/servo/pull/14491.diff","patch_url":"https://github.com/servo/servo/pull/14491.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/14491","number":14491,"state":"open","locked":false,"title":"Add domain and path checks for secure cookies eviction","user":{"login":"KiChjang","id":3248587,"avatar_url":"https://avatars.githubusercontent.com/u/3248587?v=3","gravatar_id":"","url":"https://api.github.com/users/KiChjang","html_url":"https://github.com/KiChjang","followers_url":"https://api.github.com/users/KiChjang/followers","following_url":"https://api.github.com/users/KiChjang/following{/other_user}","gists_url":"https://api.github.com/users/KiChjang/gists{/gist_id}","starred_url":"https://api.github.com/users/KiChjang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiChjang/subscriptions","organizations_url":"https://api.github.com/users/KiChjang/orgs","repos_url":"https://api.github.com/users/KiChjang/repos","events_url":"https://api.github.com/users/KiChjang/events{/privacy}","received_events_url":"https://api.github.com/users/KiChjang/received_events","type":"User","site_admin":false},"body":"Fixes #14477.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/servo/14491)\n<!-- Reviewable:end -->\n","created_at":"2016-12-08T10:06:36Z","updated_at":"2016-12-15T19:02:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"856a0a546eceb19ee874550d25c5d31301cfd98d","assignee":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"assignees":[{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/14491/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/14491/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/14491/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/5cc9952ff549cb133226f022d725881726d92dd6","head":{"label":"KiChjang:cookie-checks","ref":"cookie-checks","sha":"5cc9952ff549cb133226f022d725881726d92dd6","user":{"login":"KiChjang","id":3248587,"avatar_url":"https://avatars.githubusercontent.com/u/3248587?v=3","gravatar_id":"","url":"https://api.github.com/users/KiChjang","html_url":"https://github.com/KiChjang","followers_url":"https://api.github.com/users/KiChjang/followers","following_url":"https://api.github.com/users/KiChjang/following{/other_user}","gists_url":"https://api.github.com/users/KiChjang/gists{/gist_id}","starred_url":"https://api.github.com/users/KiChjang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiChjang/subscriptions","organizations_url":"https://api.github.com/users/KiChjang/orgs","repos_url":"https://api.github.com/users/KiChjang/repos","events_url":"https://api.github.com/users/KiChjang/events{/privacy}","received_events_url":"https://api.github.com/users/KiChjang/received_events","type":"User","site_admin":false},"repo":{"id":30110248,"name":"servo","full_name":"KiChjang/servo","owner":{"login":"KiChjang","id":3248587,"avatar_url":"https://avatars.githubusercontent.com/u/3248587?v=3","gravatar_id":"","url":"https://api.github.com/users/KiChjang","html_url":"https://github.com/KiChjang","followers_url":"https://api.github.com/users/KiChjang/followers","following_url":"https://api.github.com/users/KiChjang/following{/other_user}","gists_url":"https://api.github.com/users/KiChjang/gists{/gist_id}","starred_url":"https://api.github.com/users/KiChjang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiChjang/subscriptions","organizations_url":"https://api.github.com/users/KiChjang/orgs","repos_url":"https://api.github.com/users/KiChjang/repos","events_url":"https://api.github.com/users/KiChjang/events{/privacy}","received_events_url":"https://api.github.com/users/KiChjang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KiChjang/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/KiChjang/servo","forks_url":"https://api.github.com/repos/KiChjang/servo/forks","keys_url":"https://api.github.com/repos/KiChjang/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KiChjang/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KiChjang/servo/teams","hooks_url":"https://api.github.com/repos/KiChjang/servo/hooks","issue_events_url":"https://api.github.com/repos/KiChjang/servo/issues/events{/number}","events_url":"https://api.github.com/repos/KiChjang/servo/events","assignees_url":"https://api.github.com/repos/KiChjang/servo/assignees{/user}","branches_url":"https://api.github.com/repos/KiChjang/servo/branches{/branch}","tags_url":"https://api.github.com/repos/KiChjang/servo/tags","blobs_url":"https://api.github.com/repos/KiChjang/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KiChjang/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KiChjang/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/KiChjang/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KiChjang/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/KiChjang/servo/languages","stargazers_url":"https://api.github.com/repos/KiChjang/servo/stargazers","contributors_url":"https://api.github.com/repos/KiChjang/servo/contributors","subscribers_url":"https://api.github.com/repos/KiChjang/servo/subscribers","subscription_url":"https://api.github.com/repos/KiChjang/servo/subscription","commits_url":"https://api.github.com/repos/KiChjang/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/KiChjang/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/KiChjang/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/KiChjang/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/KiChjang/servo/contents/{+path}","compare_url":"https://api.github.com/repos/KiChjang/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KiChjang/servo/merges","archive_url":"https://api.github.com/repos/KiChjang/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KiChjang/servo/downloads","issues_url":"https://api.github.com/repos/KiChjang/servo/issues{/number}","pulls_url":"https://api.github.com/repos/KiChjang/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/KiChjang/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/KiChjang/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KiChjang/servo/labels{/name}","releases_url":"https://api.github.com/repos/KiChjang/servo/releases{/id}","deployments_url":"https://api.github.com/repos/KiChjang/servo/deployments","created_at":"2015-01-31T11:19:01Z","updated_at":"2016-01-11T11:18:01Z","pushed_at":"2016-12-12T22:01:29Z","git_url":"git://github.com/KiChjang/servo.git","ssh_url":"git@github.com:KiChjang/servo.git","clone_url":"https://github.com/KiChjang/servo.git","svn_url":"https://github.com/KiChjang/servo","homepage":"","size":222361,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"servo:master","ref":"master","sha":"b9a8ccd775c3192e3810a1730b1d0bc2b5c9dfb6","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":3390243,"name":"servo","full_name":"servo/servo","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/servo","description":"The Servo Browser Engine","fork":false,"url":"https://api.github.com/repos/servo/servo","forks_url":"https://api.github.com/repos/servo/servo/forks","keys_url":"https://api.github.com/repos/servo/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/servo/teams","hooks_url":"https://api.github.com/repos/servo/servo/hooks","issue_events_url":"https://api.github.com/repos/servo/servo/issues/events{/number}","events_url":"https://api.github.com/repos/servo/servo/events","assignees_url":"https://api.github.com/repos/servo/servo/assignees{/user}","branches_url":"https://api.github.com/repos/servo/servo/branches{/branch}","tags_url":"https://api.github.com/repos/servo/servo/tags","blobs_url":"https://api.github.com/repos/servo/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/servo/languages","stargazers_url":"https://api.github.com/repos/servo/servo/stargazers","contributors_url":"https://api.github.com/repos/servo/servo/contributors","subscribers_url":"https://api.github.com/repos/servo/servo/subscribers","subscription_url":"https://api.github.com/repos/servo/servo/subscription","commits_url":"https://api.github.com/repos/servo/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/servo/contents/{+path}","compare_url":"https://api.github.com/repos/servo/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/servo/merges","archive_url":"https://api.github.com/repos/servo/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/servo/downloads","issues_url":"https://api.github.com/repos/servo/servo/issues{/number}","pulls_url":"https://api.github.com/repos/servo/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/servo/labels{/name}","releases_url":"https://api.github.com/repos/servo/servo/releases{/id}","deployments_url":"https://api.github.com/repos/servo/servo/deployments","created_at":"2012-02-08T19:07:25Z","updated_at":"2016-12-15T10:41:21Z","pushed_at":"2016-12-15T18:55:56Z","git_url":"git://github.com/servo/servo.git","ssh_url":"git@github.com:servo/servo.git","clone_url":"https://github.com/servo/servo.git","svn_url":"https://github.com/servo/servo","homepage":"https://servo.org/","size":275744,"stargazers_count":8415,"watchers_count":8415,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1388,"mirror_url":null,"open_issues_count":1937,"forks":1388,"open_issues":1937,"watchers":8415,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/14491"},"html":{"href":"https://github.com/servo/servo/pull/14491"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/14491"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/14491/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/14491/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/14491/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/5cc9952ff549cb133226f022d725881726d92dd6"}}}}
{"actor":{"display_login":"jdm"}}