mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
reject invalid UTF-8 (#1472)
* reject invalid UTF-8 Signed-off-by: Jonas Fentker <jonas@fentker.eu> * update sytest-whitelist Signed-off-by: Jonas Fentker <jonas@fentker.eu> Co-authored-by: Kegsay <kegan@matrix.org>
This commit is contained in:
parent
f3e8ae01ef
commit
c4c8bfd027
4 changed files with 29 additions and 10 deletions
|
@ -23,6 +23,7 @@ import (
|
|||
appserviceAPI "github.com/matrix-org/dendrite/appservice/api"
|
||||
"github.com/matrix-org/dendrite/clientapi/api"
|
||||
"github.com/matrix-org/dendrite/clientapi/auth"
|
||||
clientutil "github.com/matrix-org/dendrite/clientapi/httputil"
|
||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||
"github.com/matrix-org/dendrite/clientapi/producers"
|
||||
eduServerAPI "github.com/matrix-org/dendrite/eduserver/api"
|
||||
|
@ -659,8 +660,9 @@ func Setup(
|
|||
SearchString string `json:"search_term"`
|
||||
Limit int `json:"limit"`
|
||||
}{}
|
||||
if err := json.NewDecoder(req.Body).Decode(&postContent); err != nil {
|
||||
return util.ErrorResponse(err)
|
||||
|
||||
if resErr := clientutil.UnmarshalJSONRequest(req, &postContent); resErr != nil {
|
||||
return *resErr
|
||||
}
|
||||
return *SearchUserDirectory(
|
||||
req.Context(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue