mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 16:33:11 -06:00
common/test/client: Don't panic on EOF in CanonicalJSONInput
This commit is contained in:
parent
2b166c0ca8
commit
9673792b48
|
|
@ -16,6 +16,7 @@ package test
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"sync"
|
||||
|
|
@ -58,7 +59,7 @@ func (r *LastRequestErr) Get() error {
|
|||
func CanonicalJSONInput(jsonData []string) []string {
|
||||
for i := range jsonData {
|
||||
jsonBytes, err := gomatrixserverlib.CanonicalJSON([]byte(jsonData[i]))
|
||||
if err != nil {
|
||||
if err != nil && err != io.EOF {
|
||||
panic(err)
|
||||
}
|
||||
jsonData[i] = string(jsonBytes)
|
||||
|
|
|
|||
Loading…
Reference in a new issue