From 57f90dfdd0b944c0ee82fe20ebe554f1f874fe57 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 12 Jul 2020 11:23:59 +0200 Subject: [PATCH] WIP --- src/main/java/de/trion/kafka/outbox/OutboxController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/trion/kafka/outbox/OutboxController.java b/src/main/java/de/trion/kafka/outbox/OutboxController.java index 78d4999..f1119f2 100644 --- a/src/main/java/de/trion/kafka/outbox/OutboxController.java +++ b/src/main/java/de/trion/kafka/outbox/OutboxController.java @@ -30,10 +30,11 @@ public class OutboxController { public ResponseEntity getVorgang( UriComponentsBuilder builder, @RequestBody String username) { - User user = new User(username, LocalDateTime.now(), false); + String cleaned = username.trim().toLowerCase(); + User user = new User(cleaned, LocalDateTime.now(), false); repository.save(user); // TODO: Not-Unique Fehler auslösen - UriComponents uri = builder.path("/{username}").buildAndExpand(username); + UriComponents uri = builder.path("{username}").buildAndExpand(cleaned); return ResponseEntity.created(uri.toUri()).build(); } } -- 2.20.1