Setup body wrapper in otelmux#6650
Conversation
c0b62ee to
21809eb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6650 +/- ##
=======================================
+ Coverage 73.0% 73.1% +0.1%
=======================================
Files 189 191 +2
Lines 15773 15858 +85
=======================================
+ Hits 11519 11598 +79
- Misses 3920 3925 +5
- Partials 334 335 +1
|
| w.writeHeader(http.StatusOK) | ||
| } | ||
|
|
||
| n, err := w.ResponseWriter.Write(p) |
Check warning
Code scanning / CodeQL
Reflected cross-site scripting
| // TODO: The wrapped http.ResponseWriter doesn't implement any of the optional | ||
| // types (http.Hijacker, http.Pusher, http.CloseNotifier, etc) | ||
| // that may be useful when using it in real life situations. | ||
| type RespWriterWrapper struct { |
There was a problem hiding this comment.
Does this still apply, since the way you wrap the default writer preserves the original implemented interfaces. Why would you want to implement them in RespWriterWrapper directly.
There was a problem hiding this comment.
Note that this package is a copy from the otelhttp one.
https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/net/http/otelhttp/internal/request
Which makes me think maybe it should be templatized instead, to ensure things remain in sync.
setup and implementation of a body wrapper in the
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmuxpackageThis PR addresses feedback provided in #6648