#746 Incorrect return code if entry doesn't exist
Closed: Invalid None Opened 10 years ago by edewata.

Currently if the client tries to retrieve a non-existent entry (e.g. user) the REST service will return HTTP 404 (Not Found). According to "RESTful Java with JAX-RS" it should return HTTP 204 (No Content) instead:

If the return value is null, a successful response code of 204, “No
Content” is returned. The 204 response is not an error condition.
It just tells the client that everything went OK, but that there is
no message body to look for in the response.

The HTTP 404 should be returned if the client calls a non-existent REST service (e.g. /rest/wrongpath):

In our example, if a client mistypes the request URI, for example, to
customers, it will result in the server not finding a JAX-RS resource
method that can service the request. In this case, a 404, “Not Found”
response code will be sent back to the client.

Metadata Update from @edewata:
- Issue set to the milestone: N/A

7 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/1313

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata