diff --git a/beego.go b/beego.go index c5526887..bbe6f570 100644 --- a/beego.go +++ b/beego.go @@ -156,7 +156,7 @@ func FilterPrefixPath(path string, filter http.HandlerFunc) *App { func Run() { if PprofOn { BeeApp.RegisterController(`/debug/pprof`, &ProfController{}) - BeeApp.RegisterController(`/debug/pprof/:pp([\w+])`, &ProfController{}) + BeeApp.RegisterController(`/debug/pprof/:pp([\w]+)`, &ProfController{}) } BeeApp.Run() } diff --git a/pprof.go b/pprof.go index adc44a74..03baf06b 100644 --- a/pprof.go +++ b/pprof.go @@ -18,5 +18,8 @@ func (this *ProfController) Get() { pprof.Profile(this.Ctx.ResponseWriter, this.Ctx.Request) } else if ptype == "symbol" { pprof.Symbol(this.Ctx.ResponseWriter, this.Ctx.Request) + } else { + pprof.Index(this.Ctx.ResponseWriter, this.Ctx.Request) } + this.Ctx.ResponseWriter.WriteHeader(200) }