mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-15 10:53:09 -06:00
Added error status codes
This commit is contained in:
parent
0973dfc4d6
commit
bf99e3677b
|
|
@ -109,6 +109,7 @@ func AuthFallback(
|
|||
sessionID := req.URL.Query().Get("session")
|
||||
|
||||
if sessionID == "" {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
_, err := w.Write([]byte("Session ID not provided"))
|
||||
if err != nil {
|
||||
res := httputil.LogThenError(req, err)
|
||||
|
|
@ -135,6 +136,7 @@ func AuthFallback(
|
|||
// Handle Recaptcha
|
||||
if authType == authtypes.LoginTypeRecaptcha {
|
||||
if cfg.Matrix.RecaptchaPublicKey == "" {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
_, err := w.Write([]byte("This Homeserver doesn't have a recaptcha public key"))
|
||||
if err != nil {
|
||||
res := httputil.LogThenError(req, err)
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ func Setup(
|
|||
vars := mux.Vars(req)
|
||||
return AuthFallback(w, req, vars["authType"], cfg)
|
||||
}),
|
||||
).Methods("GET", "POST", "OPTIONS")
|
||||
).Methods(http.MethodGet, http.MethodPost, http.MethodOptions)
|
||||
|
||||
r0mux.Handle("/pushrules/",
|
||||
common.MakeExternalAPI("push_rules", func(req *http.Request) util.JSONResponse {
|
||||
|
|
|
|||
Loading…
Reference in a new issue