all repos — honk @ ca80bc9b156c05c19933488c8f17e1e07822e314

my fork of honk

u
Anirudh Oppiliappan x@icyphox.sh
Sun, 24 Sep 2023 10:49:39 +0300
commit

ca80bc9b156c05c19933488c8f17e1e07822e314

parent

bd415883e232fdd901dd305469a6c404ef1cc7ff

1 files changed, 15 insertions(+), 0 deletions(-)

jump to
M web.goweb.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) +}