From 6d4ea1efb5ce3aa48fa24d1e37e015b40fe72488 Mon Sep 17 00:00:00 2001 From: Colin Henry Date: Wed, 22 Jul 2020 11:32:14 -0700 Subject: [PATCH 1/2] removed packages no longer referenced --- go.mod | 6 ------ 1 file changed, 6 deletions(-) diff --git a/go.mod b/go.mod index 5de8b60..322fc65 100755 --- a/go.mod +++ b/go.mod @@ -1,9 +1,3 @@ module github.com/jchenry/x go 1.13 - -require ( - github.com/julienschmidt/httprouter v1.2.0 - golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e - rsc.io/dbstore v0.1.1 -) From acc8d789477ff36a827eb9281c88e13d188a2ffa Mon Sep 17 00:00:00 2001 From: Colin Henry Date: Mon, 27 Jul 2020 17:20:10 -0700 Subject: [PATCH 2/2] updated signature --- net/http/auth.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/http/auth.go b/net/http/auth.go index f81c965..ac5c9ce 100644 --- a/net/http/auth.go +++ b/net/http/auth.go @@ -5,7 +5,7 @@ import ( "os" ) -func BasicAuth(fn http.HandlerFunc) http.HandlerFunc { +func BasicAuth(h http.Handler) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { user, pass, _ := r.BasicAuth() if !(user == os.Getenv("WIKI_USERNAME") && pass == os.Getenv("WIKI_PASSWORD")) { @@ -13,6 +13,7 @@ func BasicAuth(fn http.HandlerFunc) http.HandlerFunc { http.Error(w, "Unauthorized.", 401) return } - fn(w, r) + + h.ServeHTTP(w, r) } }