Return M_NOT_FOUND for rejected events (#2371)

* Return M_NOT_FOUND for rejected events

* Add passing tests
This commit is contained in:
Till 2022-04-25 19:05:01 +02:00 committed by GitHub
parent e95fc5c5e3
commit e8ab2154aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 8 deletions

View file

@ -129,6 +129,13 @@ func getState(
return nil, nil, &resErr
}
if response.IsRejected {
return nil, nil, &util.JSONResponse{
Code: http.StatusNotFound,
JSON: jsonerror.NotFound("Event not found"),
}
}
if !response.RoomExists {
return nil, nil, &util.JSONResponse{Code: http.StatusNotFound, JSON: nil}
}