MCPcopy Index your code
hub / github.com/dnote/dnote / NotFound

Method NotFound

pkg/server/controllers/static.go:39–50  ·  view source on GitHub ↗

NotFound is a catch-all handler for requests with no matching handler

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

37
38// NotFound is a catch-all handler for requests with no matching handler
39func (s *Static) NotFound(w http.ResponseWriter, r *http.Request) {
40 w.WriteHeader(http.StatusNotFound)
41
42 accept := r.Header.Get("Accept")
43
44 if strings.Contains(accept, "text/html") {
45 s.NotFoundView.Render(w, r, nil, http.StatusOK)
46 } else {
47 statusText := http.StatusText(http.StatusNotFound)
48 w.Write([]byte(statusText))
49 }
50}

Callers

nothing calls this directly

Calls 2

WriteHeaderMethod · 0.80
RenderMethod · 0.80

Tested by

no test coverage detected