server/handlerwrappers/default.rb in cpee-1.3.121 vs server/handlerwrappers/default.rb in cpee-1.3.122

- old
+ new

@@ -140,9 +140,22 @@ def vote_sync_before(parameters=nil) # {{{ @controller.call_vote("running/syncing_before", :endpoint => @handler_endpoint, :instance => "#{@url}/#{@controller.id}", :activity => @handler_position) end # }}} def callback(result) + if result.length == 1 + if result[0].is_a? Riddl::Parameter::Simple + result = result[0] + elsif result[0].is_a? Riddl::Parameter::Complex + if result[0].mimetype == 'application/json' + result = JSON::parse(result[0].value.read) + elsif result[0].mimetype == 'application/xml' || result[0].mimetype == 'text/xml' + result = XML::Smart::string(result[0].value.read) + else + result = result[0] + end + end + end @handler_returnValue = result @controller.callbacks.delete(@handler_passthrough) @handler_passthrough = nil @handler_continue.continue end