diff --git a/src/main/java/com/alterdekim/javabot/FileServerController.java b/src/main/java/com/alterdekim/javabot/FileServerController.java index 3f2c145..ac63b61 100644 --- a/src/main/java/com/alterdekim/javabot/FileServerController.java +++ b/src/main/java/com/alterdekim/javabot/FileServerController.java @@ -34,6 +34,14 @@ public class FileServerController { "attachment; filename=\"" + file.getFilename() + "\"").body(file); } + @GetMapping("/static/javascript/ace/{filename:.+}") + @ResponseBody + public ResponseEntity 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) public ResponseEntity handleStorageFileNotFound(StorageFileNotFoundException exc) { return ResponseEntity.notFound().build();