diff --git a/registry/handlers/app.go b/registry/handlers/app.go index 73680fd3a..8efdaf85e 100644 --- a/registry/handlers/app.go +++ b/registry/handlers/app.go @@ -584,8 +584,6 @@ func (app *App) configureSecret(configuration *configuration.Configuration) { } func (app *App) ServeHTTP(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() // ensure that request body is always closed. - // Prepare the context with our own little decorations. ctx := r.Context() ctx = dcontext.WithRequest(ctx, r) diff --git a/registry/handlers/tags.go b/registry/handlers/tags.go index ec0eb2337..bfd56fc62 100644 --- a/registry/handlers/tags.go +++ b/registry/handlers/tags.go @@ -34,8 +34,6 @@ type tagsAPIResponse struct { // GetTags returns a json list of tags for a specific image name. func (th *tagsHandler) GetTags(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - tagService := th.Repository.Tags(th) tags, err := tagService.All(th) if err != nil {