mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
Add default redirect for profiling when enabled.
This commit adds a simple 303 redirect for the root of profile server so launching it without a path automatically goes to the debug profiling page.
This commit is contained in:
parent
7846b2f4e2
commit
cc6cfdad9e
3
btcd.go
3
btcd.go
@ -48,6 +48,9 @@ func btcdMain() error {
|
||||
go func() {
|
||||
listenAddr := net.JoinHostPort("", cfg.Profile)
|
||||
log.Infof("Profile server listening on %s", listenAddr)
|
||||
profileRedirect := http.RedirectHandler("/debug/pprof",
|
||||
http.StatusSeeOther)
|
||||
http.Handle("/", profileRedirect)
|
||||
log.Errorf("%v", http.ListenAndServe(listenAddr, nil))
|
||||
}()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user