Skip to content
Snippets Groups Projects
Commit 96dfef9c authored by Jake Taylor's avatar Jake Taylor
Browse files

comments

parent fa2a17d9
No related branches found
No related tags found
3 merge requests!510Release,!214Project/restlike,!207WIP: Client Restructure
......@@ -25,7 +25,7 @@ type singleReceiver struct {
// Callback is the handler for single-use message reception for a RestServer
// Automatically responds to invalid endpoint requests
func (s *singleReceiver) Callback(req *single.Request, receptionId receptionID.EphemeralIdentity, rounds []rounds.Round) {
// Unmarshal the payload
// Unmarshal the request payload
newMessage := &Message{}
err := proto.Unmarshal(req.GetPayload(), newMessage)
if err != nil {
......@@ -35,7 +35,7 @@ func (s *singleReceiver) Callback(req *single.Request, receptionId receptionID.E
var respondErr error
if cb, err := s.endpoints.Get(URI(newMessage.GetUri()), Method(newMessage.GetMethod())); err == nil {
// Send the payload to the proper Callback if it exists
// Send the payload to the proper Callback if it exists and respond with the result
respondErr = respond(cb(newMessage), req)
} else {
// If no callback, automatically send an error response
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment