author | Alberto Bertogli
<albertito@blitiri.com.ar> 2021-06-11 22:29:52 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2021-06-11 22:29:52 UTC |
parent | cfe0e48c0a42bdb08c3caa563ed4d8022ffd88b3 |
internal/trace/trace.go | +10 | -0 |
diff --git a/internal/trace/trace.go b/internal/trace/trace.go index 84880c9..8dc9411 100644 --- a/internal/trace/trace.go +++ b/internal/trace/trace.go @@ -3,6 +3,7 @@ package trace import ( "fmt" + "net/http" "strconv" "blitiri.com.ar/go/log" @@ -10,6 +11,15 @@ import ( nettrace "golang.org/x/net/trace" ) +func init() { + // golang.org/x/net/trace has its own authorization which by default only + // allows localhost. This can be confusing and limiting in environments + // which access the monitoring server remotely. + nettrace.AuthRequest = func(req *http.Request) (any, sensitive bool) { + return true, true + } +} + // A Trace represents an active request. type Trace struct { family string