sendgrid-ruby 6.3.5 → 6.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e029e78d950c6d118cf0444a43ea84aaaa93a7524fb35d22e0442e9a575ae18e
4
- data.tar.gz: 136c50aab4d0f6561acccad706b2238eee7bc3d76d723055ce43f38fd4ef747a
3
+ metadata.gz: aa01e80d5c4628995eb1deeafc8dc22364917d5840e1906e3c6319c2b7a66224
4
+ data.tar.gz: 87a42bf375187c6a21fcc2432753ce96cb17c8b47f851c1d3800defc0ef9378f
5
5
  SHA512:
6
- metadata.gz: ff63561ef8b7ea73bf7125c3cd62803e0ffe50a73914fbd3736d7d3aed8a98c23f6f8b6a1ab7c07d9eefc5b1fabed78586d8d27bafd548c87d4f79f422eb430f
7
- data.tar.gz: 3d7eb06f425f60994db736113f45c9db3406b63f4bc1ff1a6e7eadd6761f8a67ba98eda05cf6830eef40fd9143046219ec3e7fa9d5b58da8bc270eddf0809a68
6
+ metadata.gz: 2689e50ffdd1914c0e0212cbfe3ac6faeb6d4c199edae135c13c5324d8d4d0c5ab39f0b5dbc33d9673c4de20540aa173262a3abfc58b000143430080d5dd68c9
7
+ data.tar.gz: b0e843dad160781bf98a01b507a7a5d7bb5a6c607a554cffede4871e7b00ce2e529de438189d33743901db48599a4fcc1b420c972de97b2df4ed54bae61813f3
@@ -2,3 +2,7 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  Style/StringLiterals:
4
4
  Enabled: false
5
+
6
+ Metrics/BlockLength:
7
+ Exclude:
8
+ - 'spec/**/*'
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ [2020-10-14] Version 6.3.6
5
+ --------------------------
6
+ **Library - Fix**
7
+ - [PR #440](https://github.com/sendgrid/sendgrid-ruby/pull/440): reading position of a request body. Thanks to [@snaka](https://github.com/snaka)!
8
+
9
+
4
10
  [2020-09-28] Version 6.3.5
5
11
  --------------------------
6
12
  **Library - Fix**
@@ -39,6 +39,8 @@ module Rack
39
39
  request.env[SendGrid::EventWebhookHeader::TIMESTAMP]
40
40
  )
41
41
 
42
+ request.body.rewind
43
+
42
44
  if verified
43
45
  @app.call(env)
44
46
  else
@@ -1,3 +1,3 @@
1
1
  module SendGrid
2
- VERSION = '6.3.5'.freeze
2
+ VERSION = '6.3.6'.freeze
3
3
  end
@@ -112,5 +112,31 @@ unless RUBY_PLATFORM == 'java'
112
112
  expect(status).to eq(403)
113
113
  end
114
114
  end
115
+
116
+ describe 'request body which passed to an app' do
117
+ before do
118
+ @payload = nil
119
+ @spy_app = lambda do |env|
120
+ @payload = Rack::Request.new(env).body
121
+ [200, { 'Content-Type' => 'text/plain' }, ['Hello']]
122
+ end
123
+ end
124
+
125
+ let(:middleware) { Rack::SendGridWebhookVerification.new(@spy_app, public_key, %r{/email}) }
126
+
127
+ it 'keeps orignal reading position' do
128
+ options = {
129
+ :input => Fixtures::EventWebhook::PAYLOAD,
130
+ 'Content-Type' => "application/json"
131
+ }
132
+ options[SendGrid::EventWebhookHeader::SIGNATURE] = Fixtures::EventWebhook::SIGNATURE
133
+ options[SendGrid::EventWebhookHeader::TIMESTAMP] = Fixtures::EventWebhook::TIMESTAMP
134
+ request = Rack::MockRequest.env_for('/email', options)
135
+ status, headers, body = middleware.call(request)
136
+ expect(status).to eq(200)
137
+ expect(@payload).not_to be_nil
138
+ expect(@payload.pos).to be_zero
139
+ end
140
+ end
115
141
  end
116
142
  end
@@ -33,7 +33,7 @@ class TestAPI < MiniTest::Test
33
33
  assert_equal(test_headers, sg.request_headers)
34
34
  assert_equal('v3', sg.version)
35
35
  assert_equal(subuser, sg.impersonate_subuser)
36
- assert_equal('6.3.5', SendGrid::VERSION)
36
+ assert_equal('6.3.6', SendGrid::VERSION)
37
37
  assert_instance_of(SendGrid::Client, sg.client)
38
38
  end
39
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.5
4
+ version: 6.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elmer Thomas
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-28 00:00:00.000000000 Z
13
+ date: 2020-10-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ruby_http_client