refactor: Redirect to / in case of unmatched path.

This commit is contained in:
HeshamTB 2023-09-22 22:57:37 +03:00
parent 3941d4761d
commit a4cc579fe3

View File

@ -267,7 +267,7 @@ func handleDirectDownload(w http.ResponseWriter, r *http.Request) {
func handleRoot(w http.ResponseWriter, r *http.Request) { func handleRoot(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" && r.URL.Path != "" { if r.URL.Path != "/" && r.URL.Path != "" {
w.WriteHeader(http.StatusNotFound) http.Redirect(w, r, "/", http.StatusPermanentRedirect)
return return
} }