Skip to content

Commit

Permalink
Merge pull request #4068 from milosgajdos/2_8-dont-close-request-body
Browse files Browse the repository at this point in the history
[release/2.8] Do not close HTTP request body in HTTP handler
  • Loading branch information
milosgajdos committed Sep 23, 2023
2 parents 2b76378 + 5e6b1b5 commit 1eb2c30
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions registry/handlers/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,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)
Expand Down
2 changes: 0 additions & 2 deletions registry/handlers/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,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 {
Expand Down

0 comments on commit 1eb2c30

Please sign in to comment.