Skip to content

Conversation

@milosgajdos
Copy link
Member

Closes #4065

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, but could use extra eyes as this always confuses me ☺️

@milosgajdos milosgajdos requested a review from corhere September 22, 2023 16:41
Copy link
Collaborator

@corhere corhere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Go 1.21 go doc says:

	// Body is the request's body.
	//
	// [...]
	//
	// For server requests, the Request Body is always non-nil
	// but will return EOF immediately when no body is present.
	// The Server will close the request body. The ServeHTTP
	// Handler does not need to.

LGTM!

@rogpeppe
Copy link

Thanks for this!

@milosgajdos milosgajdos merged commit 5e6af2f into distribution:main Sep 23, 2023
@milosgajdos milosgajdos deleted the dont-close-request-body branch September 23, 2023 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

registry/handlers: ServeHTTP method should not close request body

6 participants