func()

in adminweb/adminweb.go [48:67]


func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	if !h.SkipHTTPS && h.Forwarded.Scheme(r) != "https" {
		w.WriteHeader(http.StatusBadRequest)
		w.Write([]byte(httpsRequired))
		return
	}
	h.once.Do(func() {
		root := path.Join("/", h.Path) + "/"
		mux := http.NewServeMux()
		mux.HandleFunc(root+"debug/pprof/", pprof.Index)
		mux.HandleFunc(root+"debug/pprof/cmdline", pprof.Cmdline)
		mux.HandleFunc(root+"debug/pprof/profile", pprof.Profile)
		mux.HandleFunc(root+"debug/pprof/symbol", pprof.Symbol)
		mux.HandleFunc(root+"vars/", viewvar.Json)
		mux.HandleFunc(root+"env/", h.envHandler)
		mux.HandleFunc(root+"sleep/", httpdev.Sleep)
		h.mux = mux
	})
	h.mux.ServeHTTP(w, r)
}