Skip to content
Snippets Groups Projects
Commit 3b1ca1b8 authored by Travis Ralston's avatar Travis Ralston
Browse files

Allow pprof secret to be sent via query string too

To make `go tool pprof` a bit easier to use
parent dda70318
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment