From 93933b4afb2d9ba91f9a1c8ee6ebd804f015b115 Mon Sep 17 00:00:00 2001 From: Anant Prakash Date: Fri, 16 Mar 2018 21:49:50 +0530 Subject: [PATCH] Fix http responses in validateRecaptcha Signed-off-by: Anant Prakash --- .../matrix-org/dendrite/clientapi/routing/register.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go index e9b6050ee..f691595c6 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go @@ -179,8 +179,8 @@ func validateRecaptcha( ) *util.JSONResponse { if !cfg.Matrix.RecaptchaEnabled { return &util.JSONResponse{ - Code: http.StatusBadRequest, - JSON: jsonerror.BadJSON("Captcha registration is disabled"), + Code: http.StatusServiceUnavailable, + JSON: jsonerror.Unknown("Captcha registration is disabled"), } } @@ -215,8 +215,8 @@ func validateRecaptcha( body, err := ioutil.ReadAll(resp.Body) if err != nil { return &util.JSONResponse{ - Code: http.StatusInternalServerError, - JSON: jsonerror.BadJSON("Error in contacting captcha server" + err.Error()), + Code: http.StatusGatewayTimeout, + JSON: jsonerror.Unknown("Error in contacting captcha server" + err.Error()), } } err = json.Unmarshal(body, &r)