u
Anirudh Oppiliappan x@icyphox.sh
Sun, 21 Jan 2024 23:07:14 +0200
1 files changed,
5 insertions(+),
2 deletions(-)
jump to
M
web.go
→
web.go
@@ -2896,7 +2896,6 @@ }
mux := mux.NewRouter() mux.Use(login.Checker) - mux.Use(logit) mux.Handle("/api", login.TokenRequired(http.HandlerFunc(apihandler)))@@ -2986,6 +2985,9 @@
// mastoshit mastopost := mux.Methods("POST").Subrouter() mastoget := mux.Methods("GET").Subrouter() + mastoget.Use(logit) + mastopost.Use(logit) + mastoget.HandleFunc("/oauth/authorize", showoauthlogin) mastopost.HandleFunc("/oauth/authorize", oauthorize) mastopost.HandleFunc("/oauth/token", oauthtoken)@@ -3005,7 +3007,8 @@ h.ServeHTTP(w, r)
uri := r.URL.String() method := r.Method - elog.Println("masto:", method, uri) + status := r.Response.Status + elog.Printf("masto:%s %s (%s)", method, uri, status) } return http.HandlerFunc(fn)