In main.go made use of handler's Error func and in Error() func added missing WriteHeader().
This commit is contained in:
parent
4523e5a622
commit
35b48d29e6
@ -54,8 +54,7 @@ func main() {
|
||||
r := httpr.New()
|
||||
|
||||
r.NotFoundHandler = func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
web.ErrorXXX("/ Not Found", "", "", r.Referer(), http.StatusNotFound, w)
|
||||
dwhttp.Error(w, http.StatusNotFound, "", "", r.Referer())
|
||||
}
|
||||
|
||||
r.ServeStatic("/assets/*filepath", web.Assets())
|
||||
|
@ -188,6 +188,7 @@ func SitemapXml(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func Error(w http.ResponseWriter, code int, reason, message, referer string) {
|
||||
w.WriteHeader(code)
|
||||
web.ErrorXXX("/ "+http.StatusText(code), reason, message, referer, code, w)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user