begin
Anirudh Oppiliappan x@icyphox.sh
Mon, 13 Mar 2023 00:31:48 +0530
A
masto.go
@@ -0,0 +1,21 @@
+package main + +import ( + "net/http" + + "humungus.tedunangst.com/r/webs/junk" +) + +func badjunk(rw http.ResponseWriter, j junk.Junk) { + elog.Printf("oauthorize: bad junk: %v", j) + http.Error(rw, "oauthorize: bad junk", http.StatusBadRequest) +} + +func oauthorize(rw http.ResponseWriter, r *http.Request) { + j, err := junk.Read(r.Body) + if err != nil { + badjunk(rw, j) + } + + dlog.Println(j) +}
M
web.go
→
web.go
@@ -2803,6 +2803,9 @@ loggedin.HandleFunc("/hydra", webhydra)
loggedin.HandleFunc("/emus", showemus) loggedin.Handle("/submithonker", login.CSRFWrap("submithonker", http.HandlerFunc(websubmithonker))) + // mastoshit + getters.HandleFunc("/oauth/authorize", oauthorize) + err = http.Serve(listener, mux) if err != nil { elog.Fatal(err)