🎨 The production environment will no longer register /debug/pprof/ https://github.com/siyuan-note/siyuan/issues/10152

This commit is contained in:
Daniel 2024-01-11 20:04:31 +08:00
parent e304199b6f
commit 9779184906
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -392,6 +392,11 @@ func serveRepoDiff(ginServer *gin.Engine) {
}
func serveDebug(ginServer *gin.Engine) {
if "prod" == util.Mode {
// The production environment will no longer register `/debug/pprof/` https://github.com/siyuan-note/siyuan/issues/10152
return
}
ginServer.GET("/debug/pprof/", gin.WrapF(pprof.Index))
ginServer.GET("/debug/pprof/allocs", gin.WrapF(pprof.Index))
ginServer.GET("/debug/pprof/block", gin.WrapF(pprof.Index))