Merge branch 'master' into neilalexander/mediar0

This commit is contained in:
Neil Alexander 2020-06-17 14:05:07 +01:00
commit 131de0d9e8
2 changed files with 13 additions and 3 deletions

View file

@ -18,6 +18,7 @@ import (
"net/http" "net/http"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/matrix-org/dendrite/clientapi/jsonerror"
eduserverAPI "github.com/matrix-org/dendrite/eduserver/api" eduserverAPI "github.com/matrix-org/dendrite/eduserver/api"
federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api"
"github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/config"
@ -203,12 +204,20 @@ func Setup(
res := SendJoin( res := SendJoin(
httpReq, request, cfg, rsAPI, keys, roomID, eventID, httpReq, request, cfg, rsAPI, keys, roomID, eventID,
) )
// not all responses get wrapped in [code, body]
var body interface{}
body = []interface{}{
res.Code, res.JSON,
}
jerr, ok := res.JSON.(*jsonerror.MatrixError)
if ok {
body = jerr
}
return util.JSONResponse{ return util.JSONResponse{
Headers: res.Headers, Headers: res.Headers,
Code: res.Code, Code: res.Code,
JSON: []interface{}{ JSON: body,
res.Code, res.JSON,
},
} }
}, },
)).Methods(http.MethodPut) )).Methods(http.MethodPut)

View file

@ -333,3 +333,4 @@ Can download file 'name;with;semicolons'
Can download specifying a different ASCII file name Can download specifying a different ASCII file name
Can download with Unicode file name over federation Can download with Unicode file name over federation
Can download specifying a different Unicode file name Can download specifying a different Unicode file name
Inbound /v1/send_join rejects joins from other servers