conformance: fix http status codes for MANIFEST DELETE failures.

Previously returning 404s as failure code, dist-spec says 400s.
This commit is contained in:
Ramkumar Chinchani
2020-03-18 15:50:40 -07:00
parent 355a3b4f0e
commit 941dffe2c7
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -416,10 +416,10 @@ func (rh *RouteHandler) DeleteManifest(w http.ResponseWriter, r *http.Request) {
if err != nil {
switch err {
case errors.ErrRepoNotFound:
WriteJSON(w, http.StatusNotFound,
WriteJSON(w, http.StatusBadRequest,
NewErrorList(NewError(NAME_UNKNOWN, map[string]string{"name": name})))
case errors.ErrManifestNotFound:
WriteJSON(w, http.StatusNotFound,
WriteJSON(w, http.StatusBadRequest,
NewErrorList(NewError(MANIFEST_UNKNOWN, map[string]string{"reference": reference})))
default:
rh.c.Log.Error().Err(err).Msg("unexpected error")