diff --git a/src/main/java/cc/fascinated/backend/controller/PasteController.java b/src/main/java/cc/fascinated/backend/controller/PasteController.java index 00eedc4..f60cbb8 100644 --- a/src/main/java/cc/fascinated/backend/controller/PasteController.java +++ b/src/main/java/cc/fascinated/backend/controller/PasteController.java @@ -3,6 +3,7 @@ package cc.fascinated.backend.controller; import cc.fascinated.backend.model.Paste; import cc.fascinated.backend.service.PasteService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -26,7 +27,7 @@ public class PasteController { )); } - @PostMapping(value = "/upload") + @PostMapping(value = "/upload", consumes = MediaType.TEXT_PLAIN_VALUE) public ResponseEntity uploadPaste(@RequestBody String content) { String id = pasteService.createPaste(content); return ResponseEntity.ok(Map.of("id", id));