mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Unify the get/set scookie APIs to make them both deal with raw strings.
This commit is contained in:
parent
504094aa84
commit
824709f178
2 changed files with 17 additions and 10 deletions
|
@ -11,7 +11,7 @@ use log;
|
|||
use std::collections::HashSet;
|
||||
use file_loader;
|
||||
use hyper::client::Request;
|
||||
use hyper::header::common::{ContentLength, ContentType, Host, Location, SetCookie};
|
||||
use hyper::header::common::{ContentLength, ContentType, Host, Location};
|
||||
use hyper::HttpError;
|
||||
use hyper::method::Method;
|
||||
use hyper::net::HttpConnector;
|
||||
|
@ -189,9 +189,14 @@ reason: \"certificate verify failed\" }]";
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(&SetCookie(ref cookies)) = response.headers.get::<SetCookie>() {
|
||||
cookies_chan.send(ControlMsg::SetCookies(cookies.clone(), url.clone(),
|
||||
CookieSource::HTTP));
|
||||
if let Some(cookies) = response.headers.get_raw("set-cookie") {
|
||||
for cookie in cookies.iter() {
|
||||
if let Ok(cookies) = String::from_utf8(cookie.clone()) {
|
||||
cookies_chan.send(ControlMsg::SetCookiesForUrl(url.clone(),
|
||||
cookies,
|
||||
CookieSource::HTTP));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if response.status.class() == StatusClass::Redirection {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue