u
Anirudh Oppiliappan x@icyphox.sh
Sun, 24 Sep 2023 10:49:39 +0300
1 files changed,
15 insertions(+),
0 deletions(-)
jump to
M
web.go
→
web.go
@@ -2982,8 +2982,10 @@ loggedin.HandleFunc("/emus", showemus)
loggedin.Handle("/submithonker", login.CSRFWrap("submithonker", http.HandlerFunc(websubmithonker))) // mastoshit + getters.Use(logit) getters.HandleFunc("/oauth/authorize", oauthorize) getters.HandleFunc("/api/v1/instance", instance) + posters.Use(logit) posters.HandleFunc("/api/v1/apps", apiapps) err = http.Serve(listener, mux)@@ -2991,3 +2993,16 @@ if err != nil {
elog.Fatal(err) } } + +func logit(h http.Handler) http.Handler { + fn := func(w http.ResponseWriter, r *http.Request) { + + h.ServeHTTP(w, r) + + uri := r.URL.String() + method := r.Method + elog.Println("masto:", method, uri) + } + + return http.HandlerFunc(fn) +}