Add /send restrictions and return correct error codes (#1156)

* Add /send restrictions and return correct error codes

- Max 50 PDUs / 100 EDUs
- Fail the transaction when PDUs contain bad JSON

* Update whitelist

* Unbreak test

* Linting
This commit is contained in:
Kegsay 2020-06-23 13:15:15 +01:00 committed by GitHub
parent 4220a374ca
commit 914f6cadce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 31 deletions

View file

@ -337,7 +337,7 @@ func mustCreateTransaction(rsAPI api.RoomserverInternalAPI, fedClient txnFederat
func mustProcessTransaction(t *testing.T, txn *txnReq, pdusWithErrors []string) {
res, err := txn.processTransaction()
if err != nil {
t.Errorf("txn.processTransaction returned an error: %s", err)
t.Errorf("txn.processTransaction returned an error: %v", err)
return
}
if len(res.PDUs) != len(txn.PDUs) {