Files
2023-10-30 16:53:28 +11:00

15 lines
313 B
Go

package cloudtrace
import "net/http"
type HTTPHandler struct {
// Handler to wrap.
Handler http.Handler
}
func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx := contextWithTraceInfo(r.Context(), r.Header.Get(CloudTraceContextHeader))
h.Handler.ServeHTTP(w, r.WithContext(ctx))
}