Remove contentType check from parse endpoint

This commit is contained in:
Sandra
2022-01-31 12:05:05 +01:00
parent cab1d0dfb6
commit e666b2022d

View File

@@ -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");