From cc6cfdad9e92b3289288b2dba1e5db8af527235a Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 23 Oct 2013 09:39:02 -0500 Subject: [PATCH] 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. --- btcd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/btcd.go b/btcd.go index f119f93e..7c3bb375 100644 --- a/btcd.go +++ b/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)) }() }