Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upbumped hyper to 0.10, cookie to 0.6, webdriver to 0.22, added dependency on hyper-openssl #15775
Conversation
highfive
commented
Mar 1, 2017
|
Heads up! This PR modifies the following files:
|
|
This requires a rebase, unfortunately. |
| @@ -12,11 +12,12 @@ path = "lib.rs" | |||
| [dependencies] | |||
| brotli = "1.0.6" | |||
| content-blocker = "0.2.3" | |||
| cookie = "0.2.5" | |||
| cookie = {version = "0.6", features = ["rustc-serialize"]} | |||
This comment has been minimized.
This comment has been minimized.
|
Did a first review pass, most comments are superficial, great work. |
| .expect("Need certificate file to make network requests") | ||
| .join(certificate_file); | ||
|
|
||
| let mut ssl_connector_builder = SslConnectorBuilder::new(SslMethod::tls()).unwrap(); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| @@ -34,13 +34,23 @@ pub struct Cookie { | |||
| } | |||
|
|
|||
| impl Cookie { | |||
| pub fn new_wrapped_hyper(cookie_str: String, request: &ServoUrl, | |||
This comment has been minimized.
This comment has been minimized.
| match cookie { | ||
| Ok(cookie) => Cookie::new_wrapped(cookie, request, source), | ||
| Err(_) => None, | ||
| } |
This comment has been minimized.
This comment has been minimized.
nox
Mar 1, 2017
Member
I'm pretty sure you don't need the type annotation and whatnot here.
cookie_rs::Cookie::parse(cookie_str)
.ok()
.map(|cookie| Cookie::new_wrapped(cookie, request, source))| -> Option<Cookie> { | ||
| let mut cookie = cookie.into_owned(); |
This comment has been minimized.
This comment has been minimized.
| // Step 3 | ||
| let (persistent, expiry_time) = match (&cookie.max_age, &cookie.expires) { | ||
| let (persistent, expiry_time) = match (&cookie.max_age(), &cookie.expires()) { |
This comment has been minimized.
This comment has been minimized.
nox
Mar 1, 2017
Member
No need for the & anymore to appease the borrow checker, could you clean it up a bit?
| HTTP | ||
| } else { | ||
| NonHTTP | ||
| }; | ||
| reply.send(match (document.is_cookie_averse(), cookie.domain.clone()) { | ||
| let cookie2 = cookie.clone().to_owned(); |
This comment has been minimized.
This comment has been minimized.
| HTTP | ||
| } else { | ||
| NonHTTP | ||
| }; | ||
| reply.send(match (document.is_cookie_averse(), cookie.domain.clone()) { | ||
| let cookie2 = cookie.clone().to_owned(); | ||
| let domain = cookie2.domain().clone().to_owned(); |
This comment has been minimized.
This comment has been minimized.
| @@ -10,9 +10,9 @@ name = "webdriver_server" | |||
| path = "lib.rs" | |||
|
|
|||
| [dependencies] | |||
| cookie = "0.2.5" | |||
| cookie = {version = "0.6", features = ["rustc-serialize"]} | |||
This comment has been minimized.
This comment has been minimized.
|
|
||
| /// Time to wait for a page to finish loading upon navigation. | ||
| load_timeout: u32, | ||
| load_timeout: Option<u64>, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
avadacatavra
Mar 1, 2017
Author
Contributor
i changed it to an option to be consistent with the TimeoutParameters in webdriver
| @@ -681,7 +699,7 @@ impl Handler { | |||
| secure: params.secure, | |||
| httponly: params.httpOnly, | |||
| custom: BTreeMap::new() | |||
| }; | |||
| };*/ | |||
This comment has been minimized.
This comment has been minimized.
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net/cookie.rs, line 37 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net/cookie.rs, line 43 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net/cookie.rs, line 49 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net/cookie.rs, line 51 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. Comments from Reviewable |
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net/Cargo.toml, line 15 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. Comments from Reviewable |
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net/http_loader.rs, line 169 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net/http_loader.rs, line 202 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
let's do that as a follow up so we can get this landed components/net/http_loader.rs, line 1137 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net/http_loader.rs, line 1146 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. Comments from Reviewable |
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net/lib.rs, line 46 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. Comments from Reviewable |
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net/resource_thread.rs, line 336 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. Comments from Reviewable |
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net/connector.rs, line 36 at r1 (raw file): Previously, avadacatavra (Diane Hosfelt) wrote…
Done. Comments from Reviewable |
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net/http_loader.rs, line 205 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
can we make this a follow up components/net/http_loader.rs, line 211 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
can we make this a followup? Comments from Reviewable |
|
Review status: 0 of 27 files reviewed at latest revision, 32 unresolved discussions. components/net_traits/Cargo.toml, line 13 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net_traits/lib.rs, line 383 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net_traits/lib.rs, line 398 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/script/Cargo.toml, line 36 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/script/webdriver_handlers.rs, line 231 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/script/dom/document.rs, line 3106 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/script/dom/websocket.rs, line 504 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/webdriver_server/Cargo.toml, line 13 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/webdriver_server/lib.rs, line 702 at r1 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. Comments from Reviewable |
|
Reviewed 10 of 27 files at r1, 17 of 17 files at r2. components/net/http_loader.rs, line 202 at r1 (raw file): Previously, avadacatavra (Diane Hosfelt) wrote…
Ok, don't forget to file it. components/net/http_loader.rs, line 205 at r1 (raw file): Previously, avadacatavra (Diane Hosfelt) wrote…
Ok, don't forget to file it. components/net/http_loader.rs, line 211 at r1 (raw file): Previously, avadacatavra (Diane Hosfelt) wrote…
Ok, don't forget to file it. components/net_traits/lib.rs, line 398 at r1 (raw file): Previously, avadacatavra (Diane Hosfelt) wrote…
You sure? components/webdriver_server/lib.rs, line 112 at r1 (raw file): Previously, avadacatavra (Diane Hosfelt) wrote…
Oh, nice catch. Comments from Reviewable |
|
FYI: I haven't been following any of the discussion due to travel. Use your best judgement. |
|
@jdm We will just lowercase all the things and file a followup then. -S-awaiting-review +S-needs-code-changes Reviewed 5 of 5 files at r8. components/net/resource_thread.rs, line 329 at r8 (raw file):
Just remove the method. components/net_traits/lib.rs, line 377 at r8 (raw file):
I'm afraid my friend that this comment suggestion was for when The good news though is that you can just use the comment that was here before your changes. components/script/dom/document.rs, line 3113 at r8 (raw file):
A few final changes needed:
if let Ok(cookie_header) = SetCookie::parse_header(&[cookie.into_bytes()]) {
let cookies = cookie_header.1.into_iter().filter_map(|cookie| {
cookie_rs::Cookie::parse(cookie).ok().map(Serde)
});
let _ = self.window....;
}Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. components/net/resource_thread.rs, line 168 at r6 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/net/resource_thread.rs, line 329 at r8 (raw file): Previously, nox (Anthony Ramine) wrote…
sorry forgot to delete that :) done components/net_traits/lib.rs, line 377 at r8 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/script/dom/document.rs, line 3106 at r6 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. components/script/dom/document.rs, line 3113 at r8 (raw file): Previously, nox (Anthony Ramine) wrote…
Done. Comments from Reviewable |
|
Review status: 24 of 27 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. components/net/resource_thread.rs, line 329 at r8 (raw file): Previously, avadacatavra (Diane Hosfelt) wrote…
Done. Comments from Reviewable |
5128ad4
to
fc0c616
|
-S-awaiting-review -S-needs-rebase +S-needs-code-changes Reviewed 8 of 8 files at r9. a discussion (no related file): components/net_traits/lib.rs, line 377 at r9 (raw file):
That comment is still wrong? components/script/dom/document.rs, line 3113 at r8 (raw file): As I said earlier:
Remove the whole Comments from Reviewable |
fixed new wrapped hyper to handle strings per hyper 10 bumped to cookie 0.6 use serde_json to persist cookies in net crate fixed tests to be compatible with new cookie version fixed case mismatch with domain test bumped to webdriver 0.22
|
-S-awaiting-review +S-needs-code-changes Reviewed 4 of 4 files at r10. components/script/Cargo.toml, line 61 at r10 (raw file):
This is unneeded. Comments from Reviewable |
|
|
|
Fixed that last nit myself and rebased it in #15868. Congrats @avadacatavra. |
avadacatavra commentedMar 1, 2017
•
edited by SimonSapin
fixed new wrapped hyper to handle strings per hyper 10
bumped to cookie 0.6
use serde_json to persist cookies in net crate
fixed tests to be compatible with new cookie version
fixed case mismatch with domain test
bumped to webdriver 0.22
Bumped hyper, cookie and webdriver. Added a dependency on hyper_openssl as part of the bump.
It's important to point out that I had to fork and update websocket. I spoke with @nox about websocket/ws. This branch points to my fork. Until we migrate to ws (#14517), we'll need to maintain a fork.
Also, I believe this may fix #10550, but that might require additional verification
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is