fix: 404 if path is undefined

This commit is contained in:
HeshamTB 2023-09-20 16:18:38 +03:00
parent e3c83d0801
commit be2daeb535

View File

@ -275,6 +275,11 @@ 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)
return
}
ctx := NewContext(r)
formats := []DownloadFormats{}
formats = append(formats, DownloadFormats{