diff options
Diffstat (limited to '')
-rw-r--r-- | cmd/web/handlers.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index 667c38b..bfe73dd 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -31,6 +31,10 @@ func (app *application) listOrganisation(w http.ResponseWriter, r *http.Request) } func (app *application) home(w http.ResponseWriter, r *http.Request) { + // Check if the current request URL path exactly matches "/". If it doesn't, use + // the http.NotFound() function to send a 404 response to the client. + // Importantly, we then return from the handler. If we don't return the handler + // would keep executing. if r.URL.Path != "/" { app.notFound(w) return |