From 3b1ca1b88b60d04fffe4cb971cfdd25fc8efb718 Mon Sep 17 00:00:00 2001 From: Travis Ralston <travpc@gmail.com> Date: Sat, 10 Jun 2023 15:30:38 -0600 Subject: [PATCH] Allow pprof secret to be sent via query string too To make `go tool pprof` a bit easier to use --- api/_debug/pprof.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/_debug/pprof.go b/api/_debug/pprof.go index 09eb5cfc..bec689fb 100644 --- a/api/_debug/pprof.go +++ b/api/_debug/pprof.go @@ -37,6 +37,9 @@ func pprofServe(fn generatorFn, secret string) http.Handler { func (c *requestContainer) ServeHTTP(w http.ResponseWriter, r *http.Request) { auth := r.Header.Get("Authorization") + if auth == "" { + auth = r.URL.Query().Get("access_token") + } if auth != ("Bearer " + c.secret) { // Order is important: Set headers before sending responses w.Header().Set("Content-Type", "application/json; charset=UTF-8") -- GitLab