all repos — honk @ d689276341f5e37c67c6c47b401b7acf36bfa1cc

my fork of honk

begin
Anirudh Oppiliappan x@icyphox.sh
Mon, 13 Mar 2023 00:31:48 +0530
commit

d689276341f5e37c67c6c47b401b7acf36bfa1cc

parent

b40d307dde964d84000b7e81285bf01bfe0195df

2 files changed, 24 insertions(+), 0 deletions(-)

jump to
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.goweb.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)