commit c1b971b6c4e5b00fe6c69ae71eb073d686831c6a
parent daddd1ae4a156701fb9f0645f97525b86c5f849e
Author: cblgh <cblgh@cblgh.org>
Date: Wed, 12 Jan 2022 17:27:42 +0100
redirect after POST, fixes #10 #1
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/server/server.go b/server/server.go
@@ -186,8 +186,9 @@ func (h RequestHandler) ThreadRoute(res http.ResponseWriter, req *http.Request)
// * run sanitize step && strings.TrimSpace and check length **before** doing AddPost
// TODO(2022-01-09): send errors back to thread's posting view
h.db.AddPost(content, threadid, userid)
+ http.Redirect(res, req, req.URL.Path, http.StatusSeeOther)
+ return
}
- // after handling a post, treat the request as if it was a get request
// TODO (2022-01-07):
// * handle error
thread := h.db.GetThread(threadid)