我的 api 通过 jwt 进行保护,通过 go tool pprof
获取配置文件时是否可以指定 jwt token ?
目前,我必须配置 jwt 中间件来绕过 /debug/pprof
路由。
最佳答案
我找不到直接通过 go tool pprof
传递 token 的方法,但由于您可以使用 curl
来获取配置文件,因此是一个简单的解决方法:
$ curl -o profile.out https://host/debug/pprof -H 'X-Authorization: $TOKEN'
$ go tool pprof profile.out
关于go - 通过 "go tool pprof"获取配置文件时指定 jwt token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73277356/