From 28bab3b2824666b3b75aefdd94ec37dd7435f9e2 Mon Sep 17 00:00:00 2001 From: Martin Koppehel Date: Fri, 27 Jul 2018 12:13:42 +0200 Subject: [PATCH] Provide procedure to wildcard clients --- router/dealer.go | 10 +++++++++- wamp/options.go | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/router/dealer.go b/router/dealer.go index 41a6e488..e1c615ac 100644 --- a/router/dealer.go +++ b/router/dealer.go @@ -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) } } @@ -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{ diff --git a/wamp/options.go b/wamp/options.go index b8a9ec43..65c0f893 100644 --- a/wamp/options.go +++ b/wamp/options.go @@ -11,6 +11,7 @@ const ( OptInvoke = "invoke" OptMatch = "match" OptMode = "mode" + OptProcedure = "procedure" OptProgress = "progress" OptReceiveProgress = "receive_progress" OptTimeout = "timeout"