dev fix download with cyrrilic symbols
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-22 16:57:03 +07:00
parent 59c1b30669
commit 1536dbc845
@@ -610,10 +610,12 @@ public class ApiController {
String encodedFilename = URLEncoder.encode(filename, StandardCharsets.UTF_8) String encodedFilename = URLEncoder.encode(filename, StandardCharsets.UTF_8)
.replace("+", "%20"); .replace("+", "%20");
String safeFilename = filename.replaceAll("[^\\x00-\\x7F]", "_");
return ResponseEntity.ok() return ResponseEntity.ok()
.contentType(MediaType.APPLICATION_OCTET_STREAM) .contentType(MediaType.APPLICATION_OCTET_STREAM)
.header(HttpHeaders.CONTENT_DISPOSITION, .header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename*=UTF-8''" + encodedFilename) "attachment; filename=\"" + safeFilename + "\"; filename*=UTF-8''" + encodedFilename)
.body(bytes); .body(bytes);
} catch (FileEntityNotFoundException e) { } catch (FileEntityNotFoundException e) {
Map<String, Object> errorData = new HashMap<>(); Map<String, Object> errorData = new HashMap<>();