mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01: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
|
@ -152,7 +152,7 @@ pub struct LoadData {
|
|||
/// Unused in fetch
|
||||
pub preserved_headers: Headers,
|
||||
pub data: Option<Vec<u8>>,
|
||||
pub cors: Option<ResourceCORSData>,
|
||||
pub cors: Option<ResourceCorsData>,
|
||||
pub pipeline_id: Option<PipelineId>,
|
||||
// https://fetch.spec.whatwg.org/#concept-http-fetch step 4.3
|
||||
pub credentials_flag: bool,
|
||||
|
@ -472,7 +472,7 @@ pub struct LoadResponse {
|
|||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
|
||||
pub struct ResourceCORSData {
|
||||
pub struct ResourceCorsData {
|
||||
/// CORS Preflight flag
|
||||
pub preflight: bool,
|
||||
/// Origin of CORS Request
|
||||
|
|
|
@ -57,8 +57,8 @@ pub enum Referrer {
|
|||
pub enum RequestMode {
|
||||
Navigate,
|
||||
SameOrigin,
|
||||
NoCORS,
|
||||
CORSMode
|
||||
NoCors,
|
||||
CorsMode
|
||||
}
|
||||
|
||||
/// Request [credentials mode](https://fetch.spec.whatwg.org/#concept-request-credentials-mode)
|
||||
|
@ -92,7 +92,7 @@ pub enum RedirectMode {
|
|||
#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
|
||||
pub enum ResponseTainting {
|
||||
Basic,
|
||||
CORSTainting,
|
||||
CorsTainting,
|
||||
Opaque
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ pub enum Window {
|
|||
|
||||
/// [CORS settings attribute](https://html.spec.whatwg.org/multipage/#attr-crossorigin-anonymous)
|
||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub enum CORSSettings {
|
||||
pub enum CorsSettings {
|
||||
Anonymous,
|
||||
UseCredentials
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ impl Default for RequestInit {
|
|||
type_: Type::None,
|
||||
destination: Destination::None,
|
||||
synchronous: false,
|
||||
mode: RequestMode::NoCORS,
|
||||
mode: RequestMode::NoCors,
|
||||
use_cors_preflight: false,
|
||||
credentials_mode: CredentialsMode::Omit,
|
||||
use_url_credentials: false,
|
||||
|
@ -232,7 +232,7 @@ impl Request {
|
|||
referrer_policy: Cell::new(None),
|
||||
pipeline_id: Cell::new(pipeline_id),
|
||||
synchronous: false,
|
||||
mode: RequestMode::NoCORS,
|
||||
mode: RequestMode::NoCors,
|
||||
use_cors_preflight: false,
|
||||
credentials_mode: CredentialsMode::Omit,
|
||||
use_url_credentials: false,
|
||||
|
|
|
@ -17,7 +17,7 @@ use url::Url;
|
|||
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize, HeapSizeOf)]
|
||||
pub enum ResponseType {
|
||||
Basic,
|
||||
CORS,
|
||||
Cors,
|
||||
Default,
|
||||
Error(NetworkError),
|
||||
Opaque,
|
||||
|
@ -202,7 +202,7 @@ impl Response {
|
|||
response.headers = headers;
|
||||
},
|
||||
|
||||
ResponseType::CORS => {
|
||||
ResponseType::Cors => {
|
||||
let access = old_headers.get::<AccessControlExposeHeaders>();
|
||||
let allowed_headers = access.as_ref().map(|v| &v[..]).unwrap_or(&[]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue