mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-04-25 10:50:29 +02:00
fix incorrect OCS response from auth backend
For compliance with the OCS standard, the OCS response structure MUST be {ocs: {meta:{...}, data: {...}}}. Until now the temporary auth backend from the client only responded with the data and triggered an 'Incomplete OCS response' from the signaling server.
This commit is contained in:
parent
f894837cd1
commit
4af4a47ffd
|
@ -456,9 +456,22 @@ func registerAuthHandler(router *mux.Router) {
|
|||
return
|
||||
}
|
||||
|
||||
rawdata := json.RawMessage(data)
|
||||
payload := &signaling.OcsResponse{
|
||||
Ocs: &signaling.OcsBody{
|
||||
Data: &rawdata,
|
||||
},
|
||||
}
|
||||
|
||||
jsonpayload, err := payload.MarshalJSON()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(data)
|
||||
w.Write(jsonpayload)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue