code: func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
  	// Pprof native routing structure is not supported by julienschmidt/httprouter
  	// since it mixes prefix matches and direct matches. So we'll have to do some
  	// manual routing for paths under /debug/pprof :(
  	r.GET("/debug/pprof/*path", base, func(c *router.Context) {
  		// Validate the token generated through the portal page.
  		tok := c.Request.FormValue("tok")
  		if tok == "" {
  			sendError(c.Writer, "Missing 'tok' query parameter with a pprof token", http.StatusBadRequest)
  			return
  		}
  		switch err := checkToken(c.Context, tok); {
  		case transient.Tag.In(err):
  			sendError(c.Writer, fmt.Sprintf("Transient error, please retry: %s", err), http.StatusInternalServerError)
  			return
  		case err != nil:
  			sendError(c.Writer, fmt.Sprintf("Bad pprof token: %s", err), http.StatusBadRequest)
  			return
  		}
  
  		// Manually route. See init() in go/src/net/http/pprof/pprof.go.
  		h := pprofRoutes[c.Params.ByName("path")]
  		if h == nil {
  			h = internal.Index
  		}
  		h(c.Writer, c.Request)
  	})
  }
docs: // InstallHandlers installs HTTP handlers for pprof routes.