Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

refine: the server-side http Request Body is always non-nil #1291

Merged
merged 3 commits into from
Feb 22, 2023
Merged

Conversation

shvc
Copy link
Contributor

@shvc shvc commented Feb 21, 2023

	// 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.
	//
	// Body must allow Read to be called concurrently with Close.
	// In particular, calling Close should unblock a Read waiting
	// for input.
	Body io.ReadCloser

per net/htp/request.go, server-side http request body is always no-nil
we should use http.NoBody instead nil here

@shvc shvc requested review from a team and rghetia as code owners February 21, 2023 13:01
@google-cla
Copy link

google-cla bot commented Feb 21, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

plugin/ochttp/server.go Outdated Show resolved Hide resolved
plugin/ochttp/server.go Outdated Show resolved Hide resolved
@dashpole
Copy link
Collaborator

You will need to sign the CLA before I can merge this.

shvc and others added 2 commits February 22, 2023 09:20
Co-authored-by: David Ashpole <dashpole@google.com>
Co-authored-by: David Ashpole <dashpole@google.com>
@dashpole dashpole merged commit c12996d into census-instrumentation:master Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants