1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-02 13:30:19 +00:00

Fixed bug: error page cannot show correct corresponding status code

This commit is contained in:
Unknown
2013-07-18 14:42:45 +08:00
parent 7f4ad7ff46
commit 7f5dd13422
2 changed files with 6 additions and 0 deletions

View File

@ -445,6 +445,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
//if no matches to url, throw a not found exception
if !findrouter {
if h, ok := ErrorMaps["404"]; ok {
w.status = 404
h(w, r)
} else {
http.NotFound(w, r)