From a7e6488e724d3e3d7696bc94bb5a728da1cc225a Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 5 Jun 2024 11:58:47 +0100 Subject: [PATCH] fix ignore content type being missing on /api/upload --- .../java/cc/fascinated/backend/controller/PasteController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/backend/controller/PasteController.java b/src/main/java/cc/fascinated/backend/controller/PasteController.java index bc56b63..c29c4d9 100644 --- a/src/main/java/cc/fascinated/backend/controller/PasteController.java +++ b/src/main/java/cc/fascinated/backend/controller/PasteController.java @@ -21,7 +21,7 @@ public class PasteController { } @PostMapping(value = "/upload") - public ResponseEntity uploadPaste(@RequestBody String content, @RequestHeader(HttpHeaders.CONTENT_TYPE) String contentType) { + public ResponseEntity uploadPaste(@RequestBody String content, @RequestHeader(value = HttpHeaders.CONTENT_TYPE, required = false) String contentType) { String id = pasteService.createPaste(content, contentType); return ResponseEntity.ok(Map.of("key", id)); }