notfound-fix3
All checks were successful
deploy / deploy (push) Successful in 1m3s

This commit is contained in:
Untone 2024-10-02 19:44:23 +03:00
parent bcd66e798a
commit 1953c13f01

View File

@ -127,7 +127,6 @@ pub async fn proxy_handler(
) -> Result<HttpResponse, actix_web::Error> {
info!("proxy_handler вызван с путем: {}", path);
// весь запрошенный путь
let requested_path = match state.get_path(&path).await {
Ok(Some(path)) => path,
Ok(None) => {
@ -142,7 +141,9 @@ pub async fn proxy_handler(
info!("Запрошенный путь: {}", requested_path);
// имя файла
let filename_with_extension = requested_path.split("/").last().unwrap();
let filename_with_extension = requested_path.split("/").last().ok_or_else(|| {
actix_web::error::ErrorInternalServerError("Неверный формат пути")
})?;
info!("Имя файла с расширением: {}", filename_with_extension);
// убираем расширение файла