Redact admin prefix when registering profiling handlers, too
This commit is contained in:
parent
adaa7378ff
commit
de94c5eb49
|
@ -8,6 +8,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
@ -16,6 +17,10 @@ import (
|
|||
func registerProfileHandler(mux *httprouter.Router, verb, path string, handler http.HandlerFunc) {
|
||||
mux.HandlerFunc(verb, path, handler)
|
||||
|
||||
if Redact && AdminPrefix != "" {
|
||||
path = strings.ReplaceAll(path, AdminPrefix, "/<admin_prefix>")
|
||||
}
|
||||
|
||||
if Handlers {
|
||||
fmt.Printf("%s | SERVE: Registered handler for %s\n",
|
||||
time.Now().Format(logDate),
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
|
||||
const (
|
||||
AllowedCharacters string = `^[A-z0-9.\-_]+$`
|
||||
ReleaseVersion string = "4.0.1"
|
||||
ReleaseVersion string = "4.0.2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
Loading…
Reference in New Issue