Skip to content

Commit

Permalink
change authn and pprof api for container
Browse files Browse the repository at this point in the history
Signed-off-by: Min Min <[email protected]>
  • Loading branch information
jamsman94 committed Dec 11, 2023
1 parent 3bf9118 commit 26b5b2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pkg/microservice/aslan/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ func Serve(ctx context.Context) error {
// pprof service, you can access it by {your_ip}:8888/debug/pprof
go func() {
router := mux.NewRouter()
router.Handle("/api/debug/pprof", http.HandlerFunc(pprof.Index))
router.Handle("/api/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
router.Handle("/api/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
router.Handle("/api/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
router.Handle("/api/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
router.Handle("/api/debug/pprof/{cmd}", http.HandlerFunc(pprof.Index))
router.Handle("/debug/pprof", http.HandlerFunc(pprof.Index))
router.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
router.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
router.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
router.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
router.Handle("/debug/pprof/{cmd}", http.HandlerFunc(pprof.Index))
err := http.ListenAndServe("0.0.0.0:8888", router)
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/microservice/user/core/service/permission/authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func IsPublicURL(reqPath, method string) bool {
return true
}

if strings.HasPrefix(realPath, "/api/debug/pprof") && method == http.MethodGet {
if strings.HasPrefix(realPath, "/debug/pprof") && method == http.MethodGet {
return true
}

Expand Down

0 comments on commit 26b5b2f

Please sign in to comment.