Skip to content

Commit

Permalink
return after setting error status
Browse files Browse the repository at this point in the history
Otherwise the subsequent ctx.status overwrites the 400.
  • Loading branch information
edward3h authored Jun 25, 2024
1 parent 256cbc3 commit 356594c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/src/main/java/org/ethelred/games/server/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private void attach(Javalin server, Engine engine)

if(name.length() > 20){
ctx.json("Bad request: Player name is too long.").status(400);
return;
}

engine.playerName(getPlayerId(ctx), name);
Expand Down

0 comments on commit 356594c

Please sign in to comment.