From e1f8ea2a889494859a61a9259110e40c70002d55 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Fri, 20 Sep 2019 16:46:10 -0400 Subject: Simplify examples --- server/main.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'server/main.go') 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 -- cgit v1.2.3