use middlewares for notfoundhandler routes
This commit is contained in:
@@ -177,6 +177,9 @@ func (c *Controller) H(h adminHandler) http.Handler {
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
if resp.code != 0 {
|
||||
w.WriteHeader(resp.code)
|
||||
}
|
||||
if _, err := buff.WriteTo(w); err != nil {
|
||||
log.Printf("error writing to response buffer: %v\n", err)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func (c *Controller) ServeNotFound(r *http.Request) *Response {
|
||||
return &Response{template: "not_found.tmpl"}
|
||||
return &Response{template: "not_found.tmpl", code: 404}
|
||||
}
|
||||
|
||||
func (c *Controller) ServeLogin(r *http.Request) *Response {
|
||||
|
||||
Reference in New Issue
Block a user