Module: AWSSNSSubscription::Confirmer

Extended by:
ActiveSupport::Concern
Defined in:
lib/aws_sns_subscription/confirmer.rb

Defined Under Namespace

Classes: MessageWasNotAuthentic

Instance Method Summary collapse

Instance Method Details

#respond_to_aws_sns_subscription_confirmationsObject



6
7
8
9
10
11
12
13
# File 'lib/aws_sns_subscription/confirmer.rb', line 6

def respond_to_aws_sns_subscription_confirmations
  if request.headers["x-amz-sns-message-type"] == "SubscriptionConfirmation"
    sns = SNS.new(request.raw_post)
    raise MessageWasNotAuthentic unless sns.authentic?
    HTTParty.get sns.subscribe_url
    head :ok and return
  end
end