From 8e2bbc35f941e1dc7bddee2cf14785fea03c5f92 Mon Sep 17 00:00:00 2001 From: Jonathan Harker Date: Fri, 10 Jul 2015 01:21:58 +1200 Subject: [PATCH] Handle incoming JSON arrays in send_event. Lame fix for #593 --- lib/dashing/app.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/dashing/app.rb b/lib/dashing/app.rb index 0e7f7bb6..c7faf4df 100644 --- a/lib/dashing/app.rb +++ b/lib/dashing/app.rb @@ -102,6 +102,9 @@ def protected! post '/widgets/:id' do request.body.rewind body = JSON.parse(request.body.read) + if body.is_a?(Array) + body = {:data => body} + end auth_token = body.delete("auth_token") if !settings.auth_token || settings.auth_token == auth_token send_event(params['id'], body)