Skip to content

Commit

Permalink
Provide procedure to wildcard clients
Browse files Browse the repository at this point in the history
  • Loading branch information
martin31821 committed Jul 27, 2018
1 parent 49e11a0 commit 28bab3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion router/dealer.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,10 @@ func (d *Dealer) call(caller *session, msg *wamp.Call) {
Details: wamp.Dict{},
Error: wamp.ErrOptionDisallowedDiscloseMe,
})
} else if callee.HasFeature(roleCallee, featureCallerIdent) {
// don't continue a call when discloseMe was disallowed.
return
}
if callee.HasFeature(roleCallee, featureCallerIdent) {
discloseCaller(caller, details)
}
}
Expand All @@ -644,6 +647,11 @@ func (d *Dealer) call(caller *session, msg *wamp.Call) {
}
}

if reg.match != wamp.MatchExact {
// according to the spec, a router has to provide the actual procedure to the client.
details[wamp.OptProcedure] = msg.Procedure
}

d.calls[msg.Request] = caller
invocationID := d.idGen.Next()
d.invocations[invocationID] = &invocation{
Expand Down
1 change: 1 addition & 0 deletions wamp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const (
OptInvoke = "invoke"
OptMatch = "match"
OptMode = "mode"
OptProcedure = "procedure"
OptProgress = "progress"
OptReceiveProgress = "receive_progress"
OptTimeout = "timeout"
Expand Down

0 comments on commit 28bab3b

Please sign in to comment.