griddler-ses 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a254412f4d73e3ca99782daa1c8f067cbf916f99
4
- data.tar.gz: cf45a3a5826cf3954b21dfe3adf6ca31eba93517
3
+ metadata.gz: 8326ba89c3b93299f3a1aad824a8ce9392902ee8
4
+ data.tar.gz: a1ec605dbff34fe7289db2326e585c9a0d247150
5
5
  SHA512:
6
- metadata.gz: b78e58bd0a0541c9fb4111a53beaed53747281a9cb0de2cab6f4e2241cc95f3196f9ff2b1e2871202391addd6441b4c542f1c417756774e1fd7e8da4badf19b8
7
- data.tar.gz: 3945b1b7c8f13796a06fd15d3b27963379b781bd57e4ae357f9d2a49e86fc76e4ce7eea31c26b273f02c01d5468de8c07a5b42864b894af6c375d9f08918e889
6
+ metadata.gz: 668e3a3605a23dff1b6c04837a481ebc31262f414bc11e5022118fe58055c70817f3a7da799e6b21422e0733f0aed286becb258e5b9befb697bb404e4c977c99
7
+ data.tar.gz: 341f6c3814b24f22fb5b230442474448a32a2bedeeaf36ce3ca1cd78a74963f7c2e42c08b3f9554562a99c66db5ea12172d3ec69b62296aa500f969384077530
@@ -9,7 +9,7 @@ module Griddler
9
9
  # a bug on the AWS side doesn't set the content type to application/json type properly,
10
10
  # so we have to intercept and do this in order for Griddler's controller to correctly
11
11
  # parse the parameters (see https://forums.aws.amazon.com/thread.jspa?messageID=418160)
12
- if env['REQUEST_PATH'] == griddler_path
12
+ if is_griddler_request?(env) && is_aws_sns_request?(env)
13
13
  env['CONTENT_TYPE'] = 'application/json; charset=UTF-8'
14
14
  end
15
15
 
@@ -20,6 +20,14 @@ module Griddler
20
20
  def griddler_path
21
21
  @griddler_path ||= Rails.application.routes.url_helpers.url_for(controller: 'griddler/emails', action: 'create', only_path: true)
22
22
  end
23
+
24
+ def is_griddler_request?(request)
25
+ request['REQUEST_PATH'] == griddler_path
26
+ end
27
+
28
+ def is_aws_sns_request?(request)
29
+ request['HTTP_X_AMZ_SNS_MESSAGE_TYPE'].present?
30
+ end
23
31
  end
24
32
  end
25
33
  end
@@ -1,5 +1,5 @@
1
1
  module Griddler
2
2
  module Ses
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: griddler-ses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kent Mewhort @ Coupa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: griddler