u
Anirudh Oppiliappan x@icyphox.sh
Sun, 24 Sep 2023 10:37:02 +0300
1 files changed,
9 insertions(+),
0 deletions(-)
jump to
M
masto.go
→
masto.go
@@ -4,10 +4,16 @@ import (
"crypto/rand" "fmt" "net/http" + "runtime" "humungus.tedunangst.com/r/webs/junk" ) +func gf() string { + pc, _, _, _ := runtime.Caller(1) + return fmt.Sprintf("%s", runtime.FuncForPC(pc).Name()) +} + func badjunk(rw http.ResponseWriter, j junk.Junk, path string) { elog.Printf("%s: bad junk: %s", path, j.ToString()) http.Error(rw, fmt.Sprintf("%s: bad junk", path), http.StatusBadRequest)@@ -15,6 +21,7 @@ }
// https://docs.joinmastodon.org/methods/apps/#create func apiapps(rw http.ResponseWriter, r *http.Request) { + gf() dlog.Println(r.URL.String) dlog.Println(r.URL.RawQuery) if err := r.ParseForm(); err != nil {@@ -55,12 +62,14 @@ }
// https://docs.joinmastodon.org/methods/oauth/#authorize func oauthorize(rw http.ResponseWriter, r *http.Request) { + gf() dlog.Println("oauthorizing!") dlog.Println(r.URL.String) } // https://docs.joinmastodon.org/methods/instance/#v2 func instance(rw http.ResponseWriter, r *http.Request) { + gf() dlog.Println(r.URL.String) j := junk.New()