summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/client/accounts/accountcreate.go6
-rw-r--r--internal/api/util/errorhandling.go3
2 files changed, 3 insertions, 6 deletions
diff --git a/internal/api/client/accounts/accountcreate.go b/internal/api/client/accounts/accountcreate.go
index 6af3b41e5..5999c46c1 100644
--- a/internal/api/client/accounts/accountcreate.go
+++ b/internal/api/client/accounts/accountcreate.go
@@ -141,9 +141,5 @@ func validateCreateAccount(form *apimodel.AccountCreateRequest) error {
return err
}
- if err := validate.SignUpReason(form.Reason, config.GetAccountsReasonRequired()); err != nil {
- return err
- }
-
- return nil
+ return validate.SignUpReason(form.Reason, config.GetAccountsReasonRequired())
}
diff --git a/internal/api/util/errorhandling.go b/internal/api/util/errorhandling.go
index 8c0251e57..9128ce499 100644
--- a/internal/api/util/errorhandling.go
+++ b/internal/api/util/errorhandling.go
@@ -117,7 +117,8 @@ func ErrorHandler(c *gin.Context, errWithCode gtserror.WithCode, instanceGet fun
// or if we should just use a json. Normally we would want to
// check for a returned error, but if an error occurs here we
// can just fall back to default behavior (serve json error).
- accept, _ := NegotiateAccept(c, JSONOrHTMLAcceptHeaders...)
+ // Prefer provided offers, fall back to JSON or HTML.
+ accept, _ := NegotiateAccept(c, append(offers, JSONOrHTMLAcceptHeaders...)...)
if errWithCode.Code() == http.StatusNotFound {
// Use our special not found handler with useful status text.