mirror of
https://github.com/containers/podman.git
synced 2025-06-30 07:26:39 +08:00
Fix panic in libpod images exists endpoint
The libpod images exists endpoint panics when called with a non existing image and therefore returns 500 as status code instead of the expected 404. A test is added to ensure it is working. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
@ -51,7 +51,7 @@ func ImageExists(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if !report.Value {
|
||||
utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Wrapf(nil, "failed to find image %s", name))
|
||||
utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Errorf("failed to find image %s", name))
|
||||
return
|
||||
}
|
||||
utils.WriteResponse(w, http.StatusNoContent, "")
|
||||
|
Reference in New Issue
Block a user