mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use snake case in fetch.
This commit is contained in:
parent
4ca6325bad
commit
fa4fe01757
1 changed files with 8 additions and 8 deletions
|
@ -114,7 +114,7 @@ pub struct Request {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl Request {
|
||||||
pub fn new(url: Url, context: Context, isServiceWorkerGlobalScope: bool) -> Request {
|
pub fn new(url: Url, context: Context, is_service_worker_global_scope: bool) -> Request {
|
||||||
Request {
|
Request {
|
||||||
method: Method::Get,
|
method: Method::Get,
|
||||||
url: url,
|
url: url,
|
||||||
|
@ -122,7 +122,7 @@ impl Request {
|
||||||
unsafe_request: false,
|
unsafe_request: false,
|
||||||
body: None,
|
body: None,
|
||||||
preserve_content_codings: false,
|
preserve_content_codings: false,
|
||||||
is_service_worker_global_scope: isServiceWorkerGlobalScope,
|
is_service_worker_global_scope: is_service_worker_global_scope,
|
||||||
skip_service_worker: false,
|
skip_service_worker: false,
|
||||||
context: context,
|
context: context,
|
||||||
context_frame_type: ContextFrameType::ContextNone,
|
context_frame_type: ContextFrameType::ContextNone,
|
||||||
|
@ -268,9 +268,9 @@ impl Request {
|
||||||
Some(location) => location,
|
Some(location) => location,
|
||||||
};
|
};
|
||||||
// Step 5
|
// Step 5
|
||||||
let locationUrl = Url::parse(location);
|
let location_url = Url::parse(location);
|
||||||
// Step 6
|
// Step 6
|
||||||
let locationUrl = match locationUrl {
|
let location_url = match location_url {
|
||||||
Ok(url) => url,
|
Ok(url) => url,
|
||||||
Err(_) => return Response::network_error()
|
Err(_) => return Response::network_error()
|
||||||
};
|
};
|
||||||
|
@ -286,10 +286,10 @@ impl Request {
|
||||||
if self.redirect_mode == RedirectMode::Follow {
|
if self.redirect_mode == RedirectMode::Follow {
|
||||||
// FIXME: Origin method of the Url crate hasn't been implemented (https://github.com/servo/rust-url/issues/54)
|
// FIXME: Origin method of the Url crate hasn't been implemented (https://github.com/servo/rust-url/issues/54)
|
||||||
// Substep 1
|
// Substep 1
|
||||||
// if cors_flag && locationUrl.origin() != self.url.origin() { self.origin = None; }
|
// if cors_flag && location_url.origin() != self.url.origin() { self.origin = None; }
|
||||||
// Substep 2
|
// Substep 2
|
||||||
if cors_flag && (!locationUrl.username().unwrap_or("").is_empty() ||
|
if cors_flag && (!location_url.username().unwrap_or("").is_empty() ||
|
||||||
locationUrl.password().is_some()) {
|
location_url.password().is_some()) {
|
||||||
return Response::network_error();
|
return Response::network_error();
|
||||||
}
|
}
|
||||||
// Substep 3
|
// Substep 3
|
||||||
|
@ -299,7 +299,7 @@ impl Request {
|
||||||
self.method = Method::Get;
|
self.method = Method::Get;
|
||||||
}
|
}
|
||||||
// Substep 4
|
// Substep 4
|
||||||
self.url = locationUrl;
|
self.url = location_url;
|
||||||
// Substep 5
|
// Substep 5
|
||||||
return self.fetch(cors_flag);
|
return self.fetch(cors_flag);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue