This repository was archived by the owner on Jul 31, 2023. It is now read-only.
ochttp plugin: makes Body a transparent wrapper#1069
Merged
rghetia merged 1 commit intocensus-instrumentation:masterfrom Mar 19, 2019
GreenHorse:transparent-body
Merged
ochttp plugin: makes Body a transparent wrapper#1069rghetia merged 1 commit intocensus-instrumentation:masterfrom GreenHorse:transparent-body
rghetia merged 1 commit intocensus-instrumentation:masterfrom
GreenHorse:transparent-body
Conversation
Contributor
|
LGTM. |
Contributor
Author
|
@rghetia checks have passed |
rghetia
approved these changes
Mar 19, 2019
songy23
pushed a commit
that referenced
this pull request
Apr 3, 2019
(cherry picked from commit 6ddd4bc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With Go 1.12 the body of http.Response can implement
io.Writer.https://tip.golang.org/pkg/net/http/#Response.Body
Upgrading to websocket for example will result with a body implementing
io.Writer.https://golang.org/src/net/http/httputil/reverseproxy.go#L521
I followed the logic of wrappedResponseWriter, it might be overkill as Response.Body has only one optional interface for now.
Both
ochttp.trackerandochttp.bodyTrackerare affected.