From a4cc579fe3e5234c4e27c86148860561f79fbcc7 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 22 Sep 2023 22:57:37 +0300 Subject: [PATCH] refactor: Redirect to / in case of unmatched path. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 37d4fd4..8e78958 100644 --- a/main.go +++ b/main.go @@ -267,7 +267,7 @@ func handleDirectDownload(w http.ResponseWriter, r *http.Request) { func handleRoot(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/" && r.URL.Path != "" { - w.WriteHeader(http.StatusNotFound) + http.Redirect(w, r, "/", http.StatusPermanentRedirect) return }