Return instrumented response writer from context
This is ensures that users of the ResponseWriter from the context correctly track usage. Otherwise, context reporting is incorrect. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
a9a9658e41
commit
cb938c476f
2 changed files with 12 additions and 3 deletions
|
@ -302,7 +302,7 @@ func (irw *instrumentedResponseWriter) Flush() {
|
|||
func (irw *instrumentedResponseWriter) Value(key interface{}) interface{} {
|
||||
if keyStr, ok := key.(string); ok {
|
||||
if keyStr == "http.response" {
|
||||
return irw.ResponseWriter
|
||||
return irw
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(keyStr, "http.response.") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue