diff options
author | Ben Burwell <ben@benburwell.com> | 2019-09-20 16:46:10 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-09-20 16:46:10 -0400 |
commit | e1f8ea2a889494859a61a9259110e40c70002d55 (patch) | |
tree | 52a96d1e80840512cac11449b549ceada1f24ef1 /server/main.go | |
parent | e1eee80afa1ddf579aea52435c69813459ce3811 (diff) |
Simplify examples
Diffstat (limited to 'server/main.go')
-rw-r--r-- | server/main.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/server/main.go b/server/main.go index 23f2959..9ebcb22 100644 --- a/server/main.go +++ b/server/main.go @@ -8,16 +8,12 @@ import ( ) func main() { - server := handleCaesar(TokenAuthenticator()) + server := handleCaesar() http.ListenAndServe(":8088", server) } -func handleCaesar(auth Authenticator) http.HandlerFunc { +func handleCaesar() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - if !auth(r) { - w.WriteHeader(http.StatusUnauthorized) - return - } if r.Method != http.MethodPost { w.WriteHeader(http.StatusBadRequest) return |