u
Anirudh Oppiliappan x@icyphox.sh
Sun, 24 Sep 2023 11:31:48 +0300
1 files changed,
6 insertions(+),
7 deletions(-)
jump to
M
masto.go
→
masto.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 }