all repos — honk @ baf33afdc9ce2faa050c7c44ef80ea56029c8e79

my fork of honk

u
Anirudh Oppiliappan x@icyphox.sh
Sun, 24 Sep 2023 11:31:48 +0300
commit

baf33afdc9ce2faa050c7c44ef80ea56029c8e79

parent

41c75993540b3f2bb739c6c986abb986e294ecaf

1 files changed, 6 insertions(+), 7 deletions(-)

jump to
M masto.gomasto.go

@@ -30,6 +30,7 @@ }

clientName := r.Form.Get("client_name") redirectUri := r.Form.Get("redirect_uris") scopes := r.Form.Get("scopes") + website := r.Form.Get("website") clientID := tokengen() clientSecret := tokengen() vapidKey := tokengen()

@@ -43,6 +44,7 @@ }

j := junk.New() j["id"] = snowflake() + j["website"] = website j["name"] = clientName j["redirect_uri"] = redirectUri j["client_id"] = clientID

@@ -63,13 +65,11 @@ }

// https://docs.joinmastodon.org/methods/oauth/#authorize func oauthorize(rw http.ResponseWriter, r *http.Request) { - dlog.Println("oauthorizing!") - dlog.Println(r.URL.String) + } // https://docs.joinmastodon.org/methods/instance/#v2 func instance(rw http.ResponseWriter, r *http.Request) { - dlog.Println(r.URL.String) j := junk.New() var servername string

@@ -139,9 +139,8 @@ m["video_frame_rate_limit"] = 60

m["video_matrix_limit"] = 2304000 j["media_attachments"] = m - err := j.Write(rw) - if err != nil { - http.Error(rw, "writing json", http.StatusInternalServerError) - } + rw.WriteHeader(http.StatusOK) + rw.Write(j.ToBytes()) + return }