mirror of
https://github.com/OkaeriPoland/okaeri-timings.git
synced 2026-01-18 03:28:20 +01:00
Remove contentType check from parse endpoint
This commit is contained in:
@@ -24,10 +24,6 @@ public class ParseController {
|
|||||||
@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public ResponseEntity<?> parse(@RequestPart("file") MultipartFile file) {
|
public ResponseEntity<?> parse(@RequestPart("file") MultipartFile file) {
|
||||||
|
|
||||||
if (!"text/csv".equals(file.getContentType())) {
|
|
||||||
return ResponseEntity.badRequest().body(Map.of("error", "Expected text/csv, got: " + file.getContentType()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Instant start = Instant.now();
|
Instant start = Instant.now();
|
||||||
String content = new String(file.getBytes(), StandardCharsets.UTF_8);
|
String content = new String(file.getBytes(), StandardCharsets.UTF_8);
|
||||||
String[] lines = content.split("\r?\n");
|
String[] lines = content.split("\r?\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user