-
Notifications
You must be signed in to change notification settings - Fork 28
Description
| return buildResult(tag.orElse(null), request, new ProjectContainmentParameters(projectId)); |
If a client application sends an HTTP DELETE to the /projects/{projectId}/tags/{tagId} endpoint and no such tag exists for the given tagId in the given projectId then the code as it is will send a null element into the JSON serializer for the response. This will lead to an NPE and eventually to an HTTP 500 Server Exception being sent back to the client application.
Rather, the code should check if the request tag can be located and, if not, then either an HTTP 404 (Not Found) or a 410 (Gone) should be returned.
This oversight was discovered running a small coverage test available in one of Ed Seidewitz's repositories against a running instance of this build of the pilot implementation.
Very likely, the code pattern appears throughout the Controllers and all of the DELETE handlers need to be able to handle this situation.
v/r
Lonnie.