mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-29 00:55:51 +08:00
improve (404): 404 errors
This commit is contained in:
@ -70,8 +70,12 @@ func IndexHandler(_path string) func(*App, http.ResponseWriter, *http.Request) {
|
||||
}
|
||||
|
||||
func NotFoundHandler(ctx *App, res http.ResponseWriter, req *http.Request) {
|
||||
res.WriteHeader(http.StatusNotFound)
|
||||
res.Write(HtmlPage404)
|
||||
if strings.Contains(req.Header.Get("accept"), "text/html") {
|
||||
res.WriteHeader(http.StatusNotFound)
|
||||
res.Write(HtmlPage404)
|
||||
return
|
||||
}
|
||||
SendErrorResult(res, ErrNotFound)
|
||||
}
|
||||
|
||||
func PreflightCorsOK(ctx *App, res http.ResponseWriter, req *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user