fix: use correct response writer for tracing middle (#3693)

This commit is contained in:
Garrett Delfosse
2022-08-25 11:24:43 -05:00
committed by GitHub
parent 78a24941fe
commit b412cc1a4b
3 changed files with 42 additions and 27 deletions
+5
View File
@@ -16,6 +16,7 @@ import (
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/rbac"
"github.com/coder/coder/coderd/tracing"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/site"
)
@@ -177,5 +178,9 @@ func (api *API) workspaceAppsProxyPath(rw http.ResponseWriter, r *http.Request)
r.Header.Add("Cookie", httpapi.StripCoderCookies(cookieHeader))
}
proxy.Transport = conn.HTTPTransport()
// end span so we don't get long lived trace data
tracing.EndHTTPSpan(r, 200)
proxy.ServeHTTP(rw, r)
}