Class: Chaskiq::HooksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Chaskiq::HooksController
- Defined in:
- app/controllers/chaskiq/hooks_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#authentication_method, #get_referrer
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/chaskiq/hooks_controller.rb', line 9 def create # get amazon message type and topic = request.headers['x-amz-sns-message-type'] amz_sns_topic = request.headers['x-amz-sns-topic-arn'] #return unless !amz_sns_topic.nil? && #amz_sns_topic.to_s.downcase == 'arn:aws:sns:us-west-2:867544872691:User_Data_Updates' request_body = JSON.parse request.body.read # if this is the first time confirmation of subscription, then confirm it if .to_s.downcase == 'subscriptionconfirmation' send_subscription_confirmation request_body render text: "ok" and return end process_notification(request_body) render text: "ok" and return end |