Skip to content

Commit 91519c9

Browse files
committed
fix: remove obsolete X-XSS-Protection header
the `X-XSS-Protection` is a legacy, non-standard and deprecated header for older web browsers that don't yet support CSP (Content-Security-Policy) header. but it is deprecated and no longer considered an effective defense mechanism. - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection - https://crashtest-security.com/x-xss-protection-retired/
1 parent a75147e commit 91519c9

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/security_headers.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
99
use http::header::{
1010
CONTENT_SECURITY_POLICY, STRICT_TRANSPORT_SECURITY, X_CONTENT_TYPE_OPTIONS, X_FRAME_OPTIONS,
11-
X_XSS_PROTECTION,
1211
};
1312
use hyper::{Body, Response};
1413

@@ -27,10 +26,6 @@ pub fn append_headers(resp: &mut Response<Body>) {
2726
resp.headers_mut()
2827
.insert(X_FRAME_OPTIONS, "DENY".parse().unwrap());
2928

30-
// X-XSS-Protection
31-
resp.headers_mut()
32-
.insert(X_XSS_PROTECTION, "1; mode=block".parse().unwrap());
33-
3429
// X-Content-Type-Options
3530
resp.headers_mut()
3631
.insert(X_CONTENT_TYPE_OPTIONS, "nosniff".parse().unwrap());

0 commit comments

Comments
 (0)