mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #14156 - frewsxcv:cors-capitalization, r=KiChjang
Update CORS naming from 'CORS' to 'Cors'. As per: https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430] Acronyms should be considered one word and not all caps. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14156) <!-- Reviewable:end -->
This commit is contained in:
commit
e3f07dfa16
9 changed files with 67 additions and 67 deletions
|
@ -32,7 +32,7 @@ use ipc_channel::ipc;
|
|||
use ipc_channel::router::ROUTER;
|
||||
use js::jsval::UndefinedValue;
|
||||
use net_traits::{FetchMetadata, FetchResponseListener, Metadata, NetworkError};
|
||||
use net_traits::request::{CORSSettings, CredentialsMode, Destination, RequestInit, RequestMode, Type as RequestType};
|
||||
use net_traits::request::{CorsSettings, CredentialsMode, Destination, RequestInit, RequestMode, Type as RequestType};
|
||||
use network_listener::{NetworkListener, PreInvoke};
|
||||
use servo_atoms::Atom;
|
||||
use std::ascii::AsciiExt;
|
||||
|
@ -220,7 +220,7 @@ impl PreInvoke for ScriptContext {}
|
|||
/// https://html.spec.whatwg.org/multipage/#fetch-a-classic-script
|
||||
fn fetch_a_classic_script(script: &HTMLScriptElement,
|
||||
url: Url,
|
||||
cors_setting: Option<CORSSettings>,
|
||||
cors_setting: Option<CorsSettings>,
|
||||
character_encoding: EncodingRef) {
|
||||
let doc = document_from_node(script);
|
||||
|
||||
|
@ -232,13 +232,13 @@ fn fetch_a_classic_script(script: &HTMLScriptElement,
|
|||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
||||
// Step 1
|
||||
mode: match cors_setting {
|
||||
Some(_) => RequestMode::CORSMode,
|
||||
None => RequestMode::NoCORS,
|
||||
Some(_) => RequestMode::CorsMode,
|
||||
None => RequestMode::NoCors,
|
||||
},
|
||||
// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request
|
||||
// Step 3-4
|
||||
credentials_mode: match cors_setting {
|
||||
Some(CORSSettings::Anonymous) => CredentialsMode::CredentialsSameOrigin,
|
||||
Some(CorsSettings::Anonymous) => CredentialsMode::CredentialsSameOrigin,
|
||||
_ => CredentialsMode::Include,
|
||||
},
|
||||
origin: doc.url().clone(),
|
||||
|
@ -359,8 +359,8 @@ impl HTMLScriptElement {
|
|||
|
||||
// Step 14.
|
||||
let cors_setting = match self.GetCrossOrigin() {
|
||||
Some(ref s) if *s == "anonymous" => Some(CORSSettings::Anonymous),
|
||||
Some(ref s) if *s == "use-credentials" => Some(CORSSettings::UseCredentials),
|
||||
Some(ref s) if *s == "anonymous" => Some(CorsSettings::Anonymous),
|
||||
Some(ref s) if *s == "use-credentials" => Some(CorsSettings::UseCredentials),
|
||||
None => None,
|
||||
_ => unreachable!()
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue