all repos — honk @ 6988ba4c492fdc4dc4320faef582368be899d926

my fork of honk

masto.go (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
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 apiapps(rw http.ResponseWriter, r *http.Request) {
	j, err := junk.Read(r.Body)
	if err != nil {
		badjunk(rw, j)
	}

	dlog.Println(j)

}

func oauthorize(rw http.ResponseWriter, r *http.Request) {
	j, err := junk.Read(r.Body)
	if err != nil {
		badjunk(rw, j)
	}

	dlog.Println(j)
}