Refactored file extension extraction to use next_back for improved reliability

This commit is contained in:
Thorsten Sommer 2025-05-02 15:35:01 +02:00
parent 221b7d44ac
commit 3df1989238
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -79,7 +79,7 @@ async fn stream_data(file_path: &str) -> Result<ChunkStream> {
FileFormat::from_file(&file_path_clone)
}).await??;
let ext = file_path.split('.').last().unwrap_or("");
let ext = file_path.split('.').next_back().unwrap_or("");
let stream = match ext {
DOCX | ODT => {
let from = if ext == DOCX { "docx" } else { "odt" };