diff options
-rw-r--r-- | app/controllers/subparticipants_controller.rb | 3 | ||||
-rw-r--r-- | app/models/subparticipant.rb | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/subparticipants_controller.rb b/app/controllers/subparticipants_controller.rb index 4d1b3af..a96d399 100644 --- a/app/controllers/subparticipants_controller.rb +++ b/app/controllers/subparticipants_controller.rb @@ -52,9 +52,10 @@ class SubparticipantsController < ApplicationController sender= @participant begin json_data= ActiveSupport::JSON.decode request.raw_post - rescue StandardError + rescue ActiveSupport::OkJson::Error, StandardError raise Ecs::InvalidMessageException, "You have provided invalid JSON data (SubparticipantsController#create)." end unless request.raw_post.empty? + logger.debug "request raw post: #{(request.raw_post.empty?)?'<empty>':request.raw_post}" subparticipant= Subparticipant.generate(sender, json_data) body= show_render(subparticipant) respond_to do |format| diff --git a/app/models/subparticipant.rb b/app/models/subparticipant.rb index c764b33..7bd81f0 100644 --- a/app/models/subparticipant.rb +++ b/app/models/subparticipant.rb @@ -74,6 +74,7 @@ private end def self.process_json_data(sender, json_data) + json_data= {} unless json_data.class == Hash realm= json_data["realm"] ||= nil community_selfrouting= json_data["community_selfrouting"] || false events= json_data["events"] ||= false |