The Bug I Found When Special Characters Broke My API

java dev.to

Today, I worked on a simple Spring Boot API, but it taught me an important lesson about handling user input properly. I created an endpoint to add a scope of work to a project: @PostMapping("/addScopeOfWork/{projectId}/{scopeOfWork}") public ManageProject addScopeOfWork(@PathVariable Long projectId, @RequestBody MapString, String> data) { String scopeOfWork = data.get("scopeOfWork"); return service.addScopeOfWork(projectId, scopeOfWork); } At first , everything is fine. When I

Read Full Tutorial open_in_new
arrow_back Back to Tutorials