Created
November 28, 2016 22:56
-
-
Save ScullWM/90bfc753b9b337285084c20653c35fad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func checkAuth(h http.HandlerFunc) http.HandlerFunc { | |
return func(w http.ResponseWriter, r *http.Request) { | |
if ReadCookieHandler(r) { | |
h.ServeHTTP(w, r) | |
} else { | |
log.Printf("Not authorized %s", 401) | |
} | |
h.ServeHTTP(w, r) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment