Use StatusHandler in NotFoundHandler implementation
This commit is contained in:
parent
57e541e103
commit
b784442b6d
@ -53,9 +53,7 @@ func (h *statusHandler) ServeGemini(ctx context.Context, w ResponseWriter, r *Re
|
|||||||
// NotFoundHandler returns a simple request handler that replies to each
|
// NotFoundHandler returns a simple request handler that replies to each
|
||||||
// request with a “51 Not found” reply.
|
// request with a “51 Not found” reply.
|
||||||
func NotFoundHandler() Handler {
|
func NotFoundHandler() Handler {
|
||||||
return HandlerFunc(func(ctx context.Context, w ResponseWriter, r *Request) {
|
return StatusHandler(StatusNotFound, "Not found")
|
||||||
w.WriteHeader(StatusNotFound, "Not found")
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// StripPrefix returns a handler that serves Gemini requests by removing the
|
// StripPrefix returns a handler that serves Gemini requests by removing the
|
||||||
|
Loading…
Reference in New Issue
Block a user