Hotfix: Download file name not properly recognized by the browser as the response header is malformed

This commit is contained in:
Kresnadi Budisantoso 2023-11-29 23:25:46 +01:00
parent 9d84085d46
commit b9d473677c

View File

@ -145,7 +145,7 @@ public class RulesController implements RulesResource {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.TEXT_PLAIN);
httpHeaders.add("Content-Disposition", "attachment; filename*=utf-8\"" + ruleFileType.name() + "_" + DOWNLOAD_FILE_NAME + "\"");
httpHeaders.add("Content-Disposition", "attachment; filename*=utf-8''" + ruleFileType.name() + "_" + DOWNLOAD_FILE_NAME);
InputStream is = new ByteArrayInputStream(data);
return new ResponseEntity<>(new InputStreamResource(is), httpHeaders, HttpStatus.OK);