v0.14.15-fix
This commit is contained in:
@@ -2,6 +2,7 @@ async fn security_headers(request: Request, next: Next) -> Response {
|
||||
let path = request.uri().path();
|
||||
let is_api = path == "/api" || path.starts_with("/api/");
|
||||
let is_api_docs = path == "/api-docs" || path.starts_with("/api-docs/");
|
||||
let is_custom_chart = path.starts_with("/charts/custom/");
|
||||
|
||||
let mut response = next.run(request).await;
|
||||
|
||||
@@ -24,7 +25,7 @@ async fn security_headers(request: Request, next: Next) -> Response {
|
||||
);
|
||||
headers.insert(
|
||||
header::HeaderName::from_static("referrer-policy"),
|
||||
HeaderValue::from_static(if path.starts_with("/charts/custom/") {
|
||||
HeaderValue::from_static(if is_custom_chart {
|
||||
"no-referrer"
|
||||
} else {
|
||||
"same-origin"
|
||||
|
||||
Reference in New Issue
Block a user