From 4f0847bb24a5df77f88c883461491a2f6fd955d7 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Tue, 21 May 2019 18:49:43 -0400 Subject: runtime bugs related to api output --- post.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'post.go') diff --git a/post.go b/post.go index e829538..95cc6d3 100644 --- a/post.go +++ b/post.go @@ -20,6 +20,7 @@ func apiPostUser(w http.ResponseWriter, r *http.Request) { nick := r.FormValue("nickname") urls := r.FormValue("url") if nick == "" || urls == "" { + _, _ = w.Write([]byte("400 Bad Request: Nickname or URL Missing\n")) log400(w, r, fmt.Errorf("nickname or URL missing")) return } @@ -28,6 +29,7 @@ func apiPostUser(w http.ResponseWriter, r *http.Request) { out, remoteRegistry, err := registry.GetTwtxt(urls) if err != nil { + _, _ = w.Write([]byte(fmt.Sprintf("400 Bad Request: %v\n", err))) log400(w, r, err) return } @@ -39,6 +41,7 @@ func apiPostUser(w http.ResponseWriter, r *http.Request) { err := twtxtCache.ScrapeRemoteRegistry(urls) if err != nil { + _, _ = w.Write([]byte(fmt.Sprintf("400 Bad Request: %v\n", err))) log400(w, r, err) return } @@ -46,8 +49,9 @@ func apiPostUser(w http.ResponseWriter, r *http.Request) { return } - statuses, err := registry.ParseUserTwtxt(out) + statuses, err := registry.ParseUserTwtxt(out, nick, urls) if err != nil { + _, _ = w.Write([]byte(fmt.Sprintf("400 Bad Request: %v\n", err))) log400(w, r, err) return } -- cgit 1.4.1-2-gfad0 dec'>refs log tree commit diff stats
path: root/prototypes/browse/28/README.md
blob: f0128bde511b19dba53aa1237f8b9df35e3cac91 (plain) (blame)
1