瀏覽代碼

add security to cpu profile

abhishek9686 10 月之前
父節點
當前提交
32dfcecdff
共有 2 個文件被更改,包括 1 次插入4 次删除
  1. 1 1
      controllers/server.go
  2. 0 3
      main.go

+ 1 - 1
controllers/server.go

@@ -46,7 +46,7 @@ func serverHandlers(r *mux.Router) {
 	r.HandleFunc("/api/server/status", getStatus).Methods(http.MethodGet)
 	r.HandleFunc("/api/server/usage", logic.SecurityCheck(false, http.HandlerFunc(getUsage))).
 		Methods(http.MethodGet)
-	r.HandleFunc("/api/server/cpu_profile", cpuProfile).
+	r.HandleFunc("/api/server/cpu_profile", logic.SecurityCheck(false, http.HandlerFunc(cpuProfile))).
 		Methods(http.MethodPost)
 }
 

+ 0 - 3
main.go

@@ -51,9 +51,6 @@ func main() {
 	logic.SetAllocatedIpMap()
 	defer logic.ClearAllocatedIpMap()
 	setGarbageCollection()
-	// Start profiling
-	// profFile := logic.StartCPUProfiling()
-	// defer logic.StopCPUProfiling(profFile)
 	setVerbosity()
 	if servercfg.DeployedByOperator() && !servercfg.IsPro {
 		logic.SetFreeTierLimits()