forked from TrueCloudLab/distribution
Do not close HTTP request body in HTTP handler
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
parent
8d12329a8f
commit
f4d5210b25
2 changed files with 0 additions and 4 deletions
|
@ -584,8 +584,6 @@ func (app *App) configureSecret(configuration *configuration.Configuration) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *App) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
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.
|
// Prepare the context with our own little decorations.
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
ctx = dcontext.WithRequest(ctx, r)
|
ctx = dcontext.WithRequest(ctx, r)
|
||||||
|
|
|
@ -34,8 +34,6 @@ type tagsAPIResponse struct {
|
||||||
|
|
||||||
// GetTags returns a json list of tags for a specific image name.
|
// GetTags returns a json list of tags for a specific image name.
|
||||||
func (th *tagsHandler) GetTags(w http.ResponseWriter, r *http.Request) {
|
func (th *tagsHandler) GetTags(w http.ResponseWriter, r *http.Request) {
|
||||||
defer r.Body.Close()
|
|
||||||
|
|
||||||
tagService := th.Repository.Tags(th)
|
tagService := th.Repository.Tags(th)
|
||||||
tags, err := tagService.All(th)
|
tags, err := tagService.All(th)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue