all repos — honk @ c07856ff6a490ff41b22116029ee578acf96a77f

my fork of honk

masto.go (view raw)

 1package main
 2
 3import (
 4	"net/http"
 5
 6	"humungus.tedunangst.com/r/webs/junk"
 7)
 8
 9func badjunk(rw http.ResponseWriter, j junk.Junk) {
10	elog.Printf("oauthorize: bad junk: %v", j)
11	http.Error(rw, "oauthorize: bad junk", http.StatusBadRequest)
12}
13
14func apiapps(rw http.ResponseWriter, r *http.Request) {
15	j, err := junk.Read(r.Body)
16	if err != nil {
17		badjunk(rw, j)
18	}
19
20	dlog.Println(j)
21
22}
23
24func oauthorize(rw http.ResponseWriter, r *http.Request) {
25	j, err := junk.Read(r.Body)
26	if err != nil {
27		badjunk(rw, j)
28	}
29
30	dlog.Println(j)
31}