0.34.13_cleaup_code
This commit is contained in:
1 parent
ec46a96a29
commit
5c2e50ec06
87 files changed
+4890
-1338
No files matched your search
@@ -35,8 +35,8 @@ pub(super) fn hardening_denied_path(service: &CompiledService, path: &str) -> bo
|
||||
"id_ed25519",
|
||||
];
|
||||
let backup_suffixes = [
|
||||
".bak", ".backup", ".old", ".orig", ".save", ".swp", ".swo", ".sql",
|
||||
".sqlite", ".sqlite3", ".db",
|
||||
".bak", ".backup", ".old", ".orig", ".save", ".swp", ".swo", ".sql", ".sqlite", ".sqlite3",
|
||||
".db",
|
||||
];
|
||||
path_components(path).ok().is_some_and(|components| {
|
||||
components.iter().any(|component| {
|
||||
@@ -46,14 +46,18 @@ pub(super) fn hardening_denied_path(service: &CompiledService, path: &str) -> bo
|
||||
|| component.starts_with(".env.")
|
||||
|| sensitive_names.contains(&component.as_str())
|
||||
|| component.ends_with('~')
|
||||
|| backup_suffixes.iter().any(|suffix| component.ends_with(*suffix))
|
||||
|| backup_suffixes
|
||||
.iter()
|
||||
.any(|suffix| component.ends_with(*suffix))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
pub(super) fn hardening_denied_method(service: &CompiledService, method: &Method) -> bool {
|
||||
service.hardening.block_common_attacks
|
||||
&& (method == Method::CONNECT || method == Method::TRACE || method.as_str().eq_ignore_ascii_case("TRACK"))
|
||||
&& (method == Method::CONNECT
|
||||
|| method == Method::TRACE
|
||||
|| method.as_str().eq_ignore_ascii_case("TRACK"))
|
||||
}
|
||||
|
||||
pub(super) fn strip_unnecessary_headers(response: &mut Response, service: &CompiledService) {
|
||||
@@ -73,4 +77,3 @@ pub(super) fn strip_unnecessary_headers(response: &mut Response, service: &Compi
|
||||
response.headers_mut().remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user