MCPcopy Index your code
hub / github.com/github/github-mcp-server / renderError

Function renderError

internal/oauth/callback.go:152–157  ·  view source on GitHub ↗

renderError shows the failure page. html/template auto-escapes msg, so a hostile error_description cannot inject markup.

(w http.ResponseWriter, msg string)

Source from the content-addressed store, hash-verified

150// renderError shows the failure page. html/template auto-escapes msg, so a
151// hostile error_description cannot inject markup.
152func renderError(w http.ResponseWriter, msg string) {
153 w.Header().Set("Content-Type", "text/html; charset=utf-8")
154 if err := errorTemplate.Execute(w, struct{ ErrorMessage string }{ErrorMessage: msg}); err != nil {
155 http.Error(w, "internal error", http.StatusInternalServerError)
156 }
157}

Callers 1

handlerMethod · 0.85

Calls 2

HeaderMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected