This commit is contained in:
parent
bcd66e798a
commit
1953c13f01
|
@ -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);
|
||||
|
||||
// убираем расширение файла
|
||||
|
|
Loading…
Reference in New Issue
Block a user