u
Anirudh Oppiliappan x@icyphox.sh
Sun, 21 Jan 2024 23:42:12 +0200
1 files changed,
3 insertions(+),
5 deletions(-)
jump to
M
web.go
→
web.go
@@ -36,6 +36,7 @@ "syscall"
"time" "unicode/utf8" + "github.com/gorilla/handlers" "github.com/gorilla/mux" "humungus.tedunangst.com/r/webs/cache" "humungus.tedunangst.com/r/webs/gencache"@@ -2985,8 +2986,8 @@
// mastoshit mastopost := mux.Methods("POST").Subrouter() mastoget := mux.Methods("GET").Subrouter() - mastoget.Use(logit) mastopost.Use(logit) + mastoget.Use(logit) mastoget.HandleFunc("/oauth/authorize", showoauthlogin) mastopost.HandleFunc("/oauth/authorize", oauthorize)@@ -3002,12 +3003,9 @@ }
func logit(h http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { + handlers.LoggingHandler(os.Stdout, r) h.ServeHTTP(w, r) - - uri := r.URL.String() - method := r.Method - elog.Printf("masto: %s %s", method, uri) } return http.HandlerFunc(fn)