aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-21 09:32:06 -0500
committerAdnan Maolood <[email protected]>2021-02-21 09:32:07 -0500
commitb784442b6d1afec827f180866a44a2e793b65dec (patch)
treebf17eecab34b138a73b7824ace7c0a80419f7a8d /handler.go
parentfs: Remove unused context arguments (diff)
downloadgo-gemini-b784442b6d1afec827f180866a44a2e793b65dec.tar.xz
go-gemini-b784442b6d1afec827f180866a44a2e793b65dec.zip
Use StatusHandler in NotFoundHandler implementation
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/handler.go b/handler.go
index 2970fd0..5f3ee80 100644
--- a/handler.go
+++ b/handler.go
@@ -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
// request with a “51 Not found” reply.
func NotFoundHandler() Handler {
- return HandlerFunc(func(ctx context.Context, w ResponseWriter, r *Request) {
- w.WriteHeader(StatusNotFound, "Not found")
- })
+ return StatusHandler(StatusNotFound, "Not found")
}
// StripPrefix returns a handler that serves Gemini requests by removing the