mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Fixes tidy overlong lines
This commit is contained in:
parent
ea2d7f4dd5
commit
15d82091c5
2 changed files with 28 additions and 13 deletions
|
@ -22,7 +22,8 @@ use hyper::client::Request;
|
|||
use hyper::header::StrictTransportSecurity;
|
||||
use hyper::header::{AcceptEncoding, Accept, ContentLength, ContentType, Host, Location, qitem, Quality, QualityItem};
|
||||
use hyper::client::{Request, Response};
|
||||
use hyper::header::{AcceptEncoding, Accept, ContentLength, ContentType, Host, Location, qitem, StrictTransportSecurity};
|
||||
use hyper::header::{AcceptEncoding, Accept, ContentLength, ContentType, Host};
|
||||
use hyper::header::{Location, qitem, StrictTransportSecurity};
|
||||
use hyper::header::{Quality, QualityItem, Headers, ContentEncoding, Encoding};
|
||||
use hyper::Error as HttpError;
|
||||
use hyper::method::Method;
|
||||
|
@ -199,7 +200,10 @@ impl HttpRequestFactory for NetworkHttpRequestFactory {
|
|||
return Err(
|
||||
LoadError::Ssl(
|
||||
url.clone(),
|
||||
format!("ssl error {:?}: {:?} {:?}", io_error.kind(), io_error.description(), io_error.cause())
|
||||
format!("ssl error {:?}: {:?} {:?}",
|
||||
io_error.kind(),
|
||||
io_error.description(),
|
||||
io_error.cause())
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -468,7 +472,10 @@ pub fn load<A>(mut load_data: LoadData,
|
|||
match load_data.cors {
|
||||
Some(ref c) => {
|
||||
if c.preflight {
|
||||
return Err(LoadError::Cors(url, "Preflight fetch inconsistent with main fetch".to_string()));
|
||||
return Err(
|
||||
LoadError::Cors(
|
||||
url,
|
||||
"Preflight fetch inconsistent with main fetch".to_string()));
|
||||
} else {
|
||||
// XXXManishearth There are some CORS-related steps here,
|
||||
// but they don't seem necessary until credentials are implemented
|
||||
|
|
|
@ -284,10 +284,12 @@ fn test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_re
|
|||
let mut cookie = Headers::new();
|
||||
cookie.set_raw("Cookie".to_owned(), vec![<[_]>::to_vec("mozillaIs=theBest".as_bytes())]);
|
||||
|
||||
let _ = load::<AssertMustHaveHeadersRequest>(load_data.clone(), resource_mgr, None, &AssertMustHaveHeadersRequestFactory {
|
||||
expected_headers: cookie,
|
||||
body: <[_]>::to_vec(&*load_data.data.unwrap())
|
||||
});
|
||||
let _ = load::<AssertMustHaveHeadersRequest>(
|
||||
load_data.clone(), resource_mgr, None,
|
||||
&AssertMustHaveHeadersRequestFactory {
|
||||
expected_headers: cookie,
|
||||
body: <[_]>::to_vec(&*load_data.data.unwrap())
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -300,18 +302,24 @@ fn test_load_sets_content_length_to_length_of_request_body() {
|
|||
load_data.data = Some(<[_]>::to_vec(content.as_bytes()));
|
||||
|
||||
let mut content_len_headers= Headers::new();
|
||||
content_len_headers.set_raw("Content-Length".to_owned(), vec![<[_]>::to_vec(&*format!("{}", content.len()).as_bytes())]);
|
||||
content_len_headers.set_raw(
|
||||
"Content-Length".to_owned(), vec![<[_]>::to_vec(&*format!("{}", content.len()).as_bytes())]
|
||||
);
|
||||
|
||||
let _ = load::<AssertMustHaveHeadersRequest>(load_data.clone(), resource_mgr, None, &AssertMustHaveHeadersRequestFactory {
|
||||
expected_headers: content_len_headers,
|
||||
body: <[_]>::to_vec(&*load_data.data.unwrap())
|
||||
});
|
||||
let _ = load::<AssertMustHaveHeadersRequest>(
|
||||
load_data.clone(), resource_mgr, None,
|
||||
&AssertMustHaveHeadersRequestFactory {
|
||||
expected_headers: content_len_headers,
|
||||
body: <[_]>::to_vec(&*load_data.data.unwrap())
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_load_sets_default_accept_to_html_xhtml_xml_and_then_anything_else() {
|
||||
let mut accept_headers = Headers::new();
|
||||
accept_headers.set_raw("Accept".to_owned(), vec![b"text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8".to_vec()]);
|
||||
accept_headers.set_raw(
|
||||
"Accept".to_owned(), vec![b"text/html, application/xhtml+xml, application/xml; q=0.9, */*; q=0.8".to_vec()]
|
||||
);
|
||||
|
||||
let url = Url::parse("http://mozilla.com").unwrap();
|
||||
let resource_mgr = new_resource_task(None, None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue