#[non_exhaustive]pub struct ResponseHeadersPolicyCorsConfig { /* private fields */ }
Expand description
A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS). CloudFront adds these headers to HTTP responses that it sends for CORS requests that match a cache behavior associated with this response headers policy.
For more information about CORS, see Cross-Origin Resource Sharing (CORS) in the MDN Web Docs.
Implementations§
source§impl ResponseHeadersPolicyCorsConfig
impl ResponseHeadersPolicyCorsConfig
sourcepub fn access_control_allow_origins(
&self
) -> Option<&ResponseHeadersPolicyAccessControlAllowOrigins>
pub fn access_control_allow_origins(
&self
) -> Option<&ResponseHeadersPolicyAccessControlAllowOrigins>
A list of origins (domain names) that CloudFront can use as the value for the Access-Control-Allow-Origin
HTTP response header.
For more information about the Access-Control-Allow-Origin
HTTP response header, see Access-Control-Allow-Origin in the MDN Web Docs.
sourcepub fn access_control_allow_headers(
&self
) -> Option<&ResponseHeadersPolicyAccessControlAllowHeaders>
pub fn access_control_allow_headers(
&self
) -> Option<&ResponseHeadersPolicyAccessControlAllowHeaders>
A list of HTTP header names that CloudFront includes as values for the Access-Control-Allow-Headers
HTTP response header.
For more information about the Access-Control-Allow-Headers
HTTP response header, see Access-Control-Allow-Headers in the MDN Web Docs.
sourcepub fn access_control_allow_methods(
&self
) -> Option<&ResponseHeadersPolicyAccessControlAllowMethods>
pub fn access_control_allow_methods(
&self
) -> Option<&ResponseHeadersPolicyAccessControlAllowMethods>
A list of HTTP methods that CloudFront includes as values for the Access-Control-Allow-Methods
HTTP response header.
For more information about the Access-Control-Allow-Methods
HTTP response header, see Access-Control-Allow-Methods in the MDN Web Docs.
sourcepub fn access_control_allow_credentials(&self) -> Option<bool>
pub fn access_control_allow_credentials(&self) -> Option<bool>
A Boolean that CloudFront uses as the value for the Access-Control-Allow-Credentials
HTTP response header.
For more information about the Access-Control-Allow-Credentials
HTTP response header, see Access-Control-Allow-Credentials in the MDN Web Docs.
sourcepub fn access_control_expose_headers(
&self
) -> Option<&ResponseHeadersPolicyAccessControlExposeHeaders>
pub fn access_control_expose_headers(
&self
) -> Option<&ResponseHeadersPolicyAccessControlExposeHeaders>
A list of HTTP headers that CloudFront includes as values for the Access-Control-Expose-Headers
HTTP response header.
For more information about the Access-Control-Expose-Headers
HTTP response header, see Access-Control-Expose-Headers in the MDN Web Docs.
sourcepub fn access_control_max_age_sec(&self) -> Option<i32>
pub fn access_control_max_age_sec(&self) -> Option<i32>
A number that CloudFront uses as the value for the Access-Control-Max-Age
HTTP response header.
For more information about the Access-Control-Max-Age
HTTP response header, see Access-Control-Max-Age in the MDN Web Docs.
sourcepub fn origin_override(&self) -> Option<bool>
pub fn origin_override(&self) -> Option<bool>
A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy.
source§impl ResponseHeadersPolicyCorsConfig
impl ResponseHeadersPolicyCorsConfig
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture ResponseHeadersPolicyCorsConfig
.
Examples found in repository?
10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599
pub fn deser_structure_crate_model_response_headers_policy_cors_config(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::ResponseHeadersPolicyCorsConfig, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::ResponseHeadersPolicyCorsConfig::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("AccessControlAllowOrigins") /* AccessControlAllowOrigins com.amazonaws.cloudfront#ResponseHeadersPolicyCorsConfig$AccessControlAllowOrigins */ => {
let var_418 =
Some(
crate::xml_deser::deser_structure_crate_model_response_headers_policy_access_control_allow_origins(&mut tag)
?
)
;
builder = builder.set_access_control_allow_origins(var_418);
}
,
s if s.matches("AccessControlAllowHeaders") /* AccessControlAllowHeaders com.amazonaws.cloudfront#ResponseHeadersPolicyCorsConfig$AccessControlAllowHeaders */ => {
let var_419 =
Some(
crate::xml_deser::deser_structure_crate_model_response_headers_policy_access_control_allow_headers(&mut tag)
?
)
;
builder = builder.set_access_control_allow_headers(var_419);
}
,
s if s.matches("AccessControlAllowMethods") /* AccessControlAllowMethods com.amazonaws.cloudfront#ResponseHeadersPolicyCorsConfig$AccessControlAllowMethods */ => {
let var_420 =
Some(
crate::xml_deser::deser_structure_crate_model_response_headers_policy_access_control_allow_methods(&mut tag)
?
)
;
builder = builder.set_access_control_allow_methods(var_420);
}
,
s if s.matches("AccessControlAllowCredentials") /* AccessControlAllowCredentials com.amazonaws.cloudfront#ResponseHeadersPolicyCorsConfig$AccessControlAllowCredentials */ => {
let var_421 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_access_control_allow_credentials(var_421);
}
,
s if s.matches("AccessControlExposeHeaders") /* AccessControlExposeHeaders com.amazonaws.cloudfront#ResponseHeadersPolicyCorsConfig$AccessControlExposeHeaders */ => {
let var_422 =
Some(
crate::xml_deser::deser_structure_crate_model_response_headers_policy_access_control_expose_headers(&mut tag)
?
)
;
builder = builder.set_access_control_expose_headers(var_422);
}
,
s if s.matches("AccessControlMaxAgeSec") /* AccessControlMaxAgeSec com.amazonaws.cloudfront#ResponseHeadersPolicyCorsConfig$AccessControlMaxAgeSec */ => {
let var_423 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudfront#integer`)"))
}
?
)
;
builder = builder.set_access_control_max_age_sec(var_423);
}
,
s if s.matches("OriginOverride") /* OriginOverride com.amazonaws.cloudfront#ResponseHeadersPolicyCorsConfig$OriginOverride */ => {
let var_424 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_origin_override(var_424);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for ResponseHeadersPolicyCorsConfig
impl Clone for ResponseHeadersPolicyCorsConfig
source§fn clone(&self) -> ResponseHeadersPolicyCorsConfig
fn clone(&self) -> ResponseHeadersPolicyCorsConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more