mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.
This commit is contained in:
parent
7b87085c18
commit
ef8edd4e87
168 changed files with 2247 additions and 2408 deletions
|
@ -30,6 +30,7 @@ use hyper::header::{ContentType, Host};
|
|||
use hyper::method::Method;
|
||||
use hyper::status::StatusClass::Success;
|
||||
|
||||
use unicase::UniCase;
|
||||
use url::{SchemeData, Url};
|
||||
use util::task::spawn_named;
|
||||
|
||||
|
@ -185,10 +186,10 @@ impl CORSRequest {
|
|||
// Step 5 - 7
|
||||
let mut header_names = vec!();
|
||||
for header in self.headers.iter() {
|
||||
header_names.push(header.name().to_ascii_lowercase());
|
||||
header_names.push(header.name().to_owned());
|
||||
}
|
||||
header_names.sort();
|
||||
preflight.headers.set(AccessControlRequestHeaders(header_names));
|
||||
preflight.headers.set(AccessControlRequestHeaders(header_names.into_iter().map(UniCase).collect()));
|
||||
|
||||
// Step 8 unnecessary, we don't use the request body
|
||||
// Step 9, 10 unnecessary, we're writing our own fetch code
|
||||
|
@ -446,8 +447,8 @@ fn is_simple_method(m: &Method) -> bool {
|
|||
pub fn allow_cross_origin_request(req: &CORSRequest, headers: &Headers) -> bool {
|
||||
//FIXME(seanmonstar): use req.headers.get::<AccessControlAllowOrigin>()
|
||||
match headers.get() {
|
||||
Some(&AccessControlAllowOrigin::AllowStar) => true, // Not always true, depends on credentials mode
|
||||
Some(&AccessControlAllowOrigin::AllowOrigin(ref url)) =>
|
||||
Some(&AccessControlAllowOrigin::Any) => true, // Not always true, depends on credentials mode
|
||||
Some(&AccessControlAllowOrigin::Value(ref url)) =>
|
||||
url.scheme == req.origin.scheme &&
|
||||
url.host() == req.origin.host() &&
|
||||
url.port() == req.origin.port(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue