ciopt3
Some checks failed
Deploy quoter / deploy (push) Failing after 6m9s

This commit is contained in:
2025-10-05 10:58:24 +03:00
parent c9c183d776
commit 4fda1f179f
5 changed files with 15 additions and 1 deletions

View File

@@ -85,6 +85,7 @@ fn decode_jwt_token(token: &str) -> Result<TokenClaims, Box<dyn Error>> {
}
/// Извлекает токен из HTTP запроса (поддерживает Bearer, X-Session-Token, Cookie)
#[allow(clippy::collapsible_if)]
pub fn extract_token_from_request(req: &actix_web::HttpRequest) -> Option<String> {
// 1. Bearer токен в Authorization header
if let Some(auth_header) = req.headers().get("authorization") {

View File

@@ -117,6 +117,7 @@ pub fn create_file_response_with_analytics(
}
/// Проверяет, является ли запрос от Vercel Edge API
#[allow(clippy::collapsible_if)]
pub fn is_vercel_request(req: &HttpRequest) -> bool {
// Проверяем User-Agent на Vercel
if let Some(user_agent) = req.headers().get("user-agent") {

View File

@@ -65,6 +65,7 @@ impl SecurityConfig {
}
// Проверка длины значений заголовков
#[allow(clippy::collapsible_if)]
for (name, value) in req.headers() {
if let Ok(value_str) = value.to_str() {
if value_str.len() > self.max_header_value_length {
@@ -187,6 +188,7 @@ impl SecurityConfig {
}
/// Извлекает IP адрес клиента
#[allow(clippy::collapsible_if)]
pub fn extract_client_ip(req: &HttpRequest) -> String {
// Проверяем X-Forwarded-For (для прокси)
if let Some(forwarded) = req.headers().get("x-forwarded-for") {

View File

@@ -313,6 +313,7 @@ pub fn cleanup_cache(cache_dir: &str, max_age_days: u64) -> Result<(), Box<dyn s
let cutoff_time =
std::time::SystemTime::now() - std::time::Duration::from_secs(max_age_days * 24 * 60 * 60);
#[allow(clippy::collapsible_if)]
for entry in fs::read_dir(cache_path)? {
let entry = entry?;
let metadata = entry.metadata()?;