MCPcopy
hub / github.com/TecharoHQ/anubis / respondWithStatus

Method respondWithStatus

lib/http.go:333–337  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, msg, code string, status int)

Source from the content-addressed store, hash-verified

331}
332
333func (s *Server) respondWithStatus(w http.ResponseWriter, r *http.Request, msg, code string, status int) {
334 localizer := localization.GetLocalizer(r)
335
336 templ.Handler(web.Base(localizer.T("oh_noes"), web.ErrorPage(msg, s.opts.WebmasterEmail, code, localizer), s.policy.Impressum, localizer), templ.WithStatus(status)).ServeHTTP(w, r)
337}
338
339func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
340 if strings.HasPrefix(r.URL.Path, anubis.BasePrefix+anubis.StaticPath) {

Callers 6

RenderIndexMethod · 0.95
respondWithErrorMethod · 0.95
ServeHTTPNextMethod · 0.95
checkRulesMethod · 0.95
handleDNSBLMethod · 0.95
PassChallengeMethod · 0.95

Calls 5

GetLocalizerFunction · 0.92
BaseFunction · 0.92
ErrorPageFunction · 0.92
TMethod · 0.80
ServeHTTPMethod · 0.45

Tested by

no test coverage detected