From 9d43d8492677a693f1c60a9c793c2903312ba9eb Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 19 Feb 2019 08:45:10 -0500 Subject: [PATCH] try fixing captcha --- contrib/backends/srndv2/src/srnd/frontend_http.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/backends/srndv2/src/srnd/frontend_http.go b/contrib/backends/srndv2/src/srnd/frontend_http.go index 913fd0d..b560cb8 100644 --- a/contrib/backends/srndv2/src/srnd/frontend_http.go +++ b/contrib/backends/srndv2/src/srnd/frontend_http.go @@ -407,10 +407,17 @@ func (self *httpFrontend) HandleNewPost(nntp frontendPost) { // create a new captcha, return as json object func (self *httpFrontend) new_captcha_json(wr http.ResponseWriter, r *http.Request) { + s, err := self.store.Get(r, self.name) + if err != nil { + http.Error(wr, err.Error(), 500) + return + } captcha_id := captcha.New() resp := make(map[string]string) // the captcha id resp["id"] = captcha_id + s.Values["captcha_id"] = captcha_id + s.Save(r, wr) // url of the image resp["url"] = fmt.Sprintf("%scaptcha/%s.png", self.prefix, captcha_id) wr.Header().Set("Content-Type", "text/json; encoding=UTF-8")