aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/tests/cookie_http_state.rs
diff options
context:
space:
mode:
authorBastien Orivel <eijebong@bananium.fr>2018-08-27 18:36:52 +0200
committerBastien Orivel <eijebong@bananium.fr>2018-11-01 19:17:36 +0100
commit024b40b39d3848f1a1f7020bd7ed8c901817f09c (patch)
tree27508f102b0973cbae3dca22143ea4aedd349f4b /components/net/tests/cookie_http_state.rs
parent95bfaa0a770479fb3bf6bf0b1f85c9ae343e66ff (diff)
downloadservo-024b40b39d3848f1a1f7020bd7ed8c901817f09c.tar.gz
servo-024b40b39d3848f1a1f7020bd7ed8c901817f09c.zip
Update hyper to 0.12
Diffstat (limited to 'components/net/tests/cookie_http_state.rs')
-rw-r--r--components/net/tests/cookie_http_state.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/components/net/tests/cookie_http_state.rs b/components/net/tests/cookie_http_state.rs
index 30cec8b26b2..ab310f6a35e 100644
--- a/components/net/tests/cookie_http_state.rs
+++ b/components/net/tests/cookie_http_state.rs
@@ -2,13 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use hyper::header::{Header, SetCookie};
use net::cookie::Cookie;
use net::cookie_storage::CookieStorage;
use net_traits::CookieSource;
use servo_url::ServoUrl;
-
fn run(set_location: &str, set_cookies: &[&str], final_location: &str) -> String {
let mut storage = CookieStorage::new(150);
let url = ServoUrl::parse(set_location).unwrap();
@@ -16,14 +14,8 @@ fn run(set_location: &str, set_cookies: &[&str], final_location: &str) -> String
// Add all cookies to the store
for str_cookie in set_cookies {
- let bytes = str_cookie.to_string().into_bytes();
- let header = Header::parse_header(&[bytes]);
- if let Ok(SetCookie(cookies)) = header {
- for bare_cookie in cookies {
- if let Some(cookie) = Cookie::from_cookie_string(bare_cookie, &url, source) {
- storage.push(cookie, &url, source);
- }
- }
+ if let Some(cookie) = Cookie::from_cookie_string(str_cookie.to_owned().into(), &url, source) {
+ storage.push(cookie, &url, source);
}
}