u
Anirudh Oppiliappan x@icyphox.sh
Mon, 13 Mar 2023 23:39:51 +0530
1 files changed,
8 insertions(+),
10 deletions(-)
jump to
M
masto.go
→
masto.go
@@ -7,21 +7,19 @@
"humungus.tedunangst.com/r/webs/junk" ) -func badjunk(rw http.ResponseWriter, j junk.Junk) { - elog.Printf("oauthorize: bad junk: %s", j.ToString()) - http.Error(rw, "oauthorize: bad junk", http.StatusBadRequest) +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) } // https://docs.joinmastodon.org/methods/apps/#create func apiapps(rw http.ResponseWriter, r *http.Request) { - j, err := junk.Read(r.Body) - if err != nil { - badjunk(rw, j) - return - } + clientName := r.Form.Get("client_name") + redirectUris := r.Form.Get("redirect_uris") + scopes := r.Form.Get("scopes") + web := r.Form.Get("website") - dlog.Println(j) - + dlog.Println(clientName, redirectUris, scopes, web) } // https://docs.joinmastodon.org/methods/oauth/#authorize