clipped2
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -3079,7 +3079,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "quoter"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
dependencies = [
|
||||
"actix",
|
||||
"actix-cors",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "quoter"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -52,6 +52,7 @@ pub struct Author {
|
||||
}
|
||||
|
||||
/// Получает айди пользователя из токена в заголовке
|
||||
#[allow(clippy::collapsible_if)]
|
||||
pub async fn get_id_by_token(token: &str) -> Result<String, Box<dyn Error>> {
|
||||
let auth_api_base = env::var("CORE_URL")?;
|
||||
let query_name = "validate_jwt_token";
|
||||
|
||||
@@ -19,6 +19,7 @@ fn create_cached_response(content_type: &str, data: Vec<u8>, file_etag: &str) ->
|
||||
}
|
||||
|
||||
/// Обработчик для скачивания файла и генерации миниатюры, если она недоступна.
|
||||
#[allow(clippy::collapsible_if)]
|
||||
pub async fn proxy_handler(
|
||||
req: HttpRequest,
|
||||
requested_res: web::Path<String>,
|
||||
|
||||
@@ -71,6 +71,7 @@ pub async fn load_file_from_s3(
|
||||
}
|
||||
|
||||
/// Генерирует ключ с правильным расширением на основе MIME-типа.
|
||||
#[allow(clippy::collapsible_if)]
|
||||
pub fn generate_key_with_extension(base_key: String, mime_type: String) -> String {
|
||||
let mime: mime::Mime =
|
||||
mime::Mime::from_str(&mime_type).unwrap_or(mime::APPLICATION_OCTET_STREAM);
|
||||
|
||||
@@ -13,6 +13,7 @@ pub const THUMB_WIDTHS: [u32; 7] = [10, 40, 110, 300, 600, 800, 1400];
|
||||
/// - "unsafe/1440x/production/image/439efaa0-816f-11ef-b201-439da98539bc.jpg" -> ("439efaa0-816f-11ef-b201-439da98539bc", 1440, "jpg")
|
||||
/// - "unsafe/production/image/5627e002-0c53-11ee-9565-0242ac110006.png" -> ("5627e002-0c53-11ee-9565-0242ac110006", 0, "png")
|
||||
/// - "unsafe/development/image/439efaa0-816f-11ef-b201-439da98539bc.jpg/webp" -> ("439efaa0-816f-11ef-b201-439da98539bc", 0, "webp")
|
||||
#[allow(clippy::collapsible_if)]
|
||||
pub fn parse_file_path(requested_path: &str) -> (String, u32, String) {
|
||||
let mut path = requested_path.to_string();
|
||||
if requested_path.ends_with("/webp") {
|
||||
|
||||
Reference in New Issue
Block a user