mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-13 09:53:10 -06:00
Fix http responses in validateRecaptcha
Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>
This commit is contained in:
parent
c9add39768
commit
93933b4afb
|
|
@ -179,8 +179,8 @@ func validateRecaptcha(
|
||||||
) *util.JSONResponse {
|
) *util.JSONResponse {
|
||||||
if !cfg.Matrix.RecaptchaEnabled {
|
if !cfg.Matrix.RecaptchaEnabled {
|
||||||
return &util.JSONResponse{
|
return &util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusServiceUnavailable,
|
||||||
JSON: jsonerror.BadJSON("Captcha registration is disabled"),
|
JSON: jsonerror.Unknown("Captcha registration is disabled"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -215,8 +215,8 @@ func validateRecaptcha(
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &util.JSONResponse{
|
return &util.JSONResponse{
|
||||||
Code: http.StatusInternalServerError,
|
Code: http.StatusGatewayTimeout,
|
||||||
JSON: jsonerror.BadJSON("Error in contacting captcha server" + err.Error()),
|
JSON: jsonerror.Unknown("Error in contacting captcha server" + err.Error()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = json.Unmarshal(body, &r)
|
err = json.Unmarshal(body, &r)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue