handlers: Fix the naming of all handlers.

This commit is contained in:
Harshavardhana
2016-02-04 14:57:20 -08:00
parent 4d97c042da
commit 012fbe756b
5 changed files with 36 additions and 36 deletions
+5 -5
View File
@@ -23,18 +23,18 @@ import (
jwtgo "github.com/dgrijalva/jwt-go"
)
type authHandler struct {
type jwtAuthHandler struct {
handler http.Handler
}
// AuthHandler -
// setJWTAuthHandler -
// Verify if authorization header is of form JWT, reject it otherwise.
func AuthHandler(h http.Handler) http.Handler {
return authHandler{h}
func setJWTAuthHandler(h http.Handler) http.Handler {
return jwtAuthHandler{h}
}
// Ignore request if authorization header is not valid.
func (h authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (h jwtAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Let the top level caller handle if the requests should be
// allowed, if there are no Authorization headers.
if r.Header.Get("Authorization") == "" {