Modify 403 status code to const variable (#349)

* Modify http status code to variable

* Modify doc
This commit is contained in:
Geon Kim
2018-02-26 01:08:54 +09:00
committed by Matt Silverlock
parent c0091a0299
commit d284fd8421
2 changed files with 2 additions and 2 deletions

2
doc.go
View File

@@ -287,7 +287,7 @@ A more complex authentication middleware, which maps session token to users, cou
log.Printf("Authenticated user %s\n", user) log.Printf("Authenticated user %s\n", user)
next.ServeHTTP(w, r) next.ServeHTTP(w, r)
} else { } else {
http.Error(w, "Forbidden", 403) http.Error(w, "Forbidden", http.StatusForbidden)
} }
}) })
} }

View File

@@ -30,7 +30,7 @@ func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler
log.Printf("Authenticated user %s\n", user) log.Printf("Authenticated user %s\n", user)
next.ServeHTTP(w, r) next.ServeHTTP(w, r)
} else { } else {
http.Error(w, "Forbidden", 403) http.Error(w, "Forbidden", http.StatusForbidden)
} }
}) })
} }