add code editor js fix

This commit is contained in:
Michael Wain 2024-07-04 21:27:39 +03:00
parent 0fcd998990
commit 20f7a38d32

View File

@ -34,6 +34,14 @@ public class FileServerController {
"attachment; filename=\"" + file.getFilename() + "\"").body(file); "attachment; filename=\"" + file.getFilename() + "\"").body(file);
} }
@GetMapping("/static/javascript/ace/{filename:.+}")
@ResponseBody
public ResponseEntity<Resource> serveFileAce(@PathVariable String filename) {
Resource file = storageService.loadAsResource("static/javascript/ace/" + filename);
return ResponseEntity.ok().contentType(new MediaType("text", "javascript")).header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=\"" + file.getFilename() + "\"").body(file);
}
@ExceptionHandler(StorageFileNotFoundException.class) @ExceptionHandler(StorageFileNotFoundException.class)
public ResponseEntity<?> handleStorageFileNotFound(StorageFileNotFoundException exc) { public ResponseEntity<?> handleStorageFileNotFound(StorageFileNotFoundException exc) {
return ResponseEntity.notFound().build(); return ResponseEntity.notFound().build();