remove nil response to 404 translation for PatchOperation #13167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #12687 included translation of a nil
logical.Response
for aPatchOperation
request to a 404. After further review, there are cases whereCreateOperation
andUpdateOperation
handlers return a nil response resulting in a 204. It is prudent to remain consistent for operations against the same endpoint. With that said, it makes sense to remove this global translation. Backends will need to call thelogical.RespondWithStatusCode
withhttp.StatusNotFound
to embed a404 Not Found
as thehttp_status_code
for thelogical.Response
.The
TestHandler_Patch_NotFound
test has been removed as that was written specifically to ensure that the global nil -> 404 translation occurred.PR #56 for
vault-plugin-secrets-kv
removes the implied404 Not Found
response by returning a nillogical.Response
in favor of an explicit response.