content disposition: fixed filename

This commit is contained in:
Michele Artini 2023-12-14 13:56:01 +01:00
parent a88d0e59f6
commit d7c220e88d
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ public class PublicApiController {
res.sendError(HttpStatus.BAD_REQUEST.value(), "Invalid year");
}
final String filename = String.format("%s_%s_%s.log", year, month, country);
final String filename = String.format("%04d_%02d_%s.log", year, month, country);
res.setContentType(MediaType.TEXT_PLAIN.getType());
res.setHeader("Content-Disposition", "attachment; filename=" + filename);