mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-24 01:04:39 +01:00
improve (404): 404 errors
This commit is contained in:
parent
2197385d54
commit
e2874f2a9b
1 changed files with 6 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue