MCPcopy Create free account
hub / github.com/coder/coder / ServeHTTPDebug

Method ServeHTTPDebug

enterprise/tailnet/htmldebug.go:44–61  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

42}
43
44func (c *pgCoord) ServeHTTPDebug(w http.ResponseWriter, r *http.Request) {
45 ctx := r.Context()
46 debug, err := getDebug(ctx, c.store)
47 if err != nil {
48 w.WriteHeader(http.StatusInternalServerError)
49 _, _ = w.Write([]byte(err.Error()))
50 return
51 }
52
53 w.Header().Set("Content-Type", "text/html; charset=utf-8")
54
55 err = debugTempl.Execute(w, debug)
56 if err != nil {
57 w.WriteHeader(http.StatusInternalServerError)
58 _, _ = w.Write([]byte(err.Error()))
59 return
60 }
61}
62
63func getDebug(ctx context.Context, store database.Store) (HTMLDebug, error) {
64 out := HTMLDebug{}

Callers

nothing calls this directly

Calls 8

getDebugFunction · 0.85
ContextMethod · 0.65
WriteMethod · 0.65
SetMethod · 0.65
ExecuteMethod · 0.65
WriteHeaderMethod · 0.45
ErrorMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected