diff --git a/errors.go b/errors.go
index 5a6337ed..45ce9114 100644
--- a/errors.go
+++ b/errors.go
@@ -189,6 +189,7 @@ func NotFound(rw http.ResponseWriter, r *http.Request) {
"
You like 404 pages" +
"")
data["BeegoVersion"] = VERSION
+ rw.WriteHeader(http.StatusNotFound)
t.Execute(rw, data)
}
@@ -204,6 +205,7 @@ func Unauthorized(rw http.ResponseWriter, r *http.Request) {
"
Check the address for errors" +
"")
data["BeegoVersion"] = VERSION
+ rw.WriteHeader(http.StatusUnauthorized)
t.Execute(rw, data)
}
@@ -220,6 +222,7 @@ func Forbidden(rw http.ResponseWriter, r *http.Request) {
"
You need to log in" +
"")
data["BeegoVersion"] = VERSION
+ rw.WriteHeader(http.StatusForbidden)
t.Execute(rw, data)
}
@@ -235,6 +238,7 @@ func ServiceUnavailable(rw http.ResponseWriter, r *http.Request) {
"
Please try again later." +
"")
data["BeegoVersion"] = VERSION
+ rw.WriteHeader(http.StatusServiceUnavailable)
t.Execute(rw, data)
}
@@ -249,6 +253,7 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) {
"
you should report the fault to the website administrator" +
"")
data["BeegoVersion"] = VERSION
+ rw.WriteHeader(http.StatusInternalServerError)
t.Execute(rw, data)
}
diff --git a/router.go b/router.go
index 4029c8e7..ad745ea4 100644
--- a/router.go
+++ b/router.go
@@ -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)