mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-05 07:13:09 +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
|
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.Header().Set("Content-Type", "application/json")
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write(data)
|
w.Write(jsonpayload)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue