#[non_exhaustive]pub struct ResponseHeadersPolicyXssProtection { /* private fields */ }
Expand description
Determines whether CloudFront includes the X-XSS-Protection
HTTP response header and the header’s value.
For more information about the X-XSS-Protection
HTTP response header, see X-XSS-Protection in the MDN Web Docs.
Implementations§
source§impl ResponseHeadersPolicyXssProtection
impl ResponseHeadersPolicyXssProtection
sourcepub fn override(&self) -> Option<bool>
pub fn override(&self) -> Option<bool>
A Boolean that determines whether CloudFront overrides the X-XSS-Protection
HTTP response header received from the origin with the one specified in this response headers policy.
sourcepub fn protection(&self) -> Option<bool>
pub fn protection(&self) -> Option<bool>
A Boolean that determines the value of the X-XSS-Protection
HTTP response header. When this setting is true
, the value of the X-XSS-Protection
header is 1
. When this setting is false
, the value of the X-XSS-Protection
header is 0
.
For more information about these settings, see X-XSS-Protection in the MDN Web Docs.
sourcepub fn mode_block(&self) -> Option<bool>
pub fn mode_block(&self) -> Option<bool>
A Boolean that determines whether CloudFront includes the mode=block
directive in the X-XSS-Protection
header.
For more information about this directive, see X-XSS-Protection in the MDN Web Docs.
sourcepub fn report_uri(&self) -> Option<&str>
pub fn report_uri(&self) -> Option<&str>
A reporting URI, which CloudFront uses as the value of the report
directive in the X-XSS-Protection
header.
You cannot specify a ReportUri
when ModeBlock
is true
.
For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.
source§impl ResponseHeadersPolicyXssProtection
impl ResponseHeadersPolicyXssProtection
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture ResponseHeadersPolicyXssProtection
.
Examples found in repository?
12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375
pub fn deser_structure_crate_model_response_headers_policy_xss_protection(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::ResponseHeadersPolicyXssProtection, aws_smithy_xml::decode::XmlDecodeError>
{
#[allow(unused_mut)]
let mut builder = crate::model::ResponseHeadersPolicyXssProtection::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Override") /* Override com.amazonaws.cloudfront#ResponseHeadersPolicyXSSProtection$Override */ => {
let var_490 =
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_override(var_490);
}
,
s if s.matches("Protection") /* Protection com.amazonaws.cloudfront#ResponseHeadersPolicyXSSProtection$Protection */ => {
let var_491 =
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_protection(var_491);
}
,
s if s.matches("ModeBlock") /* ModeBlock com.amazonaws.cloudfront#ResponseHeadersPolicyXSSProtection$ModeBlock */ => {
let var_492 =
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_mode_block(var_492);
}
,
s if s.matches("ReportUri") /* ReportUri com.amazonaws.cloudfront#ResponseHeadersPolicyXSSProtection$ReportUri */ => {
let var_493 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_report_uri(var_493);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for ResponseHeadersPolicyXssProtection
impl Clone for ResponseHeadersPolicyXssProtection
source§fn clone(&self) -> ResponseHeadersPolicyXssProtection
fn clone(&self) -> ResponseHeadersPolicyXssProtection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more