mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-08 08:52:27 +02:00
Merge pull request #74 from loelkes/master
Make the response from the client auth backend OCS compliant
This commit is contained in:
commit
fd96d4e506
|
@ -209,6 +209,9 @@ func (c *SignalingClient) processMessage(message *signaling.ServerMessage) {
|
||||||
case "bye":
|
case "bye":
|
||||||
log.Printf("Received bye: %+v\n", message.Bye)
|
log.Printf("Received bye: %+v\n", message.Bye)
|
||||||
c.Close()
|
c.Close()
|
||||||
|
case "error":
|
||||||
|
log.Printf("Received error: %+v\n", message.Error)
|
||||||
|
c.Close()
|
||||||
default:
|
default:
|
||||||
log.Printf("Unsupported message type: %+v\n", *message)
|
log.Printf("Unsupported message type: %+v\n", *message)
|
||||||
}
|
}
|
||||||
|
@ -453,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