mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-10 07:37:26 +02:00
http response name convention.
This commit is contained in:
parent
3f312c84ad
commit
c4978ba376
6 changed files with 11 additions and 11 deletions
|
@ -27,7 +27,7 @@ func AdminsOnly(next http.Handler) http.Handler {
|
|||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
session := GetSession(r)
|
||||
if !session.Admin() {
|
||||
utils.HttpNotAuthorized(w)
|
||||
utils.HttpForbidden(w)
|
||||
} else {
|
||||
next.ServeHTTP(w, r)
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ func HostsOnly(next http.Handler) http.Handler {
|
|||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
session := GetSession(r)
|
||||
if !session.IsHost() {
|
||||
utils.HttpNotAuthorized(w, "Only host can do this.")
|
||||
utils.HttpForbidden(w, "Only host can do this.")
|
||||
} else {
|
||||
next.ServeHTTP(w, r)
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ func HostsOrAdminsOnly(next http.Handler) http.Handler {
|
|||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
session := GetSession(r)
|
||||
if !session.IsHost() && !session.Admin() {
|
||||
utils.HttpNotAuthorized(w, "Only host can do this.")
|
||||
utils.HttpForbidden(w, "Only host can do this.")
|
||||
} else {
|
||||
next.ServeHTTP(w, r)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue