patron 0.12.0 → 0.12.1

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: 7eb76f695d888463be44f05ca6bc3f8acb345953
4
- data.tar.gz: 6e53654564c133b451743d14126b9833c6d2f20a
3
+ metadata.gz: 7d150d662006fa9751021e94126b0ef52432fb45
4
+ data.tar.gz: 240cfef423d0c4aec7c363da618bbd8966d9d8a0
5
5
  SHA512:
6
- metadata.gz: 4954733879999e8a0012059ce2972c664fec4f47be970f9bb1ae58cd52da2d040e95ef722421c56e85a268110e2096e957cb0a92a98e258e80f111f5407224d5
7
- data.tar.gz: ad4c2bf766cac5916a35d4612d06a096f2a5b21fa89c4c8b6b933a13c25b6e01a7fe0501c2a7244c57a389b6f210a90c527d4c56062d4c5ed7c6a4a60dff6dfd
6
+ metadata.gz: 75e5e3b6c0c4df36c763ee3a84efdd0771599aae2eed85fb0c8f91596d9304a06e2a209f1b06283b1a461d88dfe6a3eebd34f594e18f7b57bb44d119a256fbed
7
+ data.tar.gz: d5ae239b30d06e0c143d2fe821bf5110f17aa811b83c69ccabb02e1d2b4a96a954e3eb9fc5509fdd88adc4fc765db0ce53f537e788c6873e769b494005536e94
@@ -1,3 +1,7 @@
1
+ ### 0.12.1
2
+
3
+ * Ensure HTTP2 response headers/status lines are correctly handled
4
+
1
5
  ### 0.12.0
2
6
 
3
7
  * Replace StringScanner in HeaderParser with StringIO, fix Webmock regression when the headers string would
@@ -1,5 +1,5 @@
1
1
  module Patron::HeaderParser
2
- HTTP_STATUS_LINE_START_RE = /^HTTP\/\d\.\d \d+/
2
+ HTTP_STATUS_LINE_START_RE = /^HTTP\/\d(\.\d)? \d+/
3
3
  HEADER_LINE_START_RE = /^[^:]+\:/
4
4
 
5
5
  # Returned for each response parsed out
@@ -1,3 +1,3 @@
1
1
  module Patron
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.1"
3
3
  end
@@ -84,4 +84,18 @@ describe Patron::HeaderParser do
84
84
  last_header = first_response.headers[-1]
85
85
  expect(last_header).to eq('Connection: Close')
86
86
  end
87
+
88
+ it 'parses headers for an HTTP2 response' do
89
+ path = File.dirname(__FILE__) + '/sample_response_headers/sample_http2_header.txt'
90
+ responses = Patron::HeaderParser.parse(File.read(path))
91
+
92
+ expect(responses.length).to eq(1)
93
+ first_response = responses[0]
94
+
95
+ expect(first_response.status_line).to eq("HTTP/2 200")
96
+ expect(first_response.headers).to be_kind_of(Array)
97
+ expect(first_response.headers).not_to be_empty
98
+ last_header = first_response.headers[-1]
99
+ expect(last_header).to eq('strict-transport-security: max-age=15552000; includeSubDomains;')
100
+ end
87
101
  end
@@ -0,0 +1,16 @@
1
+ HTTP/2 200
2
+ date: Fri, 16 Feb 2018 01:59:32 GMT
3
+ content-type: text/html; charset=utf-8
4
+ x-frame-options: SAMEORIGIN
5
+ x-xss-protection: 1; mode=block
6
+ x-content-type-options: nosniff
7
+ cache-control: no-cache, no-store, max-age=0, must-revalidate
8
+ pragma: no-cache
9
+ expires: Fri, 01 Jan 1990 00:00:00 GMT
10
+ vary: Accept-Encoding, Origin
11
+ set-cookie: _wt_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTAyMTlhNTA4ZDNlYzVlMWJlMDFjZDdiOWUwMDBmMjAzBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMWxHRlFjRjNGRXRaS2pVR1RrNXVvNHkwZ3didUV4L1htTXExRUppYytNV1k9BjsARg%3D%3D--15724585750f7e220903e84f5978758cb8c67aea; domain=wetransfer.com; path=/; secure; HttpOnly
12
+ x-request-id: 668bd810-42ae-4e02-8c58-3f9d7b052365
13
+ x-opaque: 6d43d0f0705486926447448fc17c8ded512fdeaf-1.wt-17271
14
+ x-runtime: 0.159185
15
+ strict-transport-security: max-age=15552000; includeSubDomains;
16
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phillip Toland
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-05 00:00:00.000000000 Z
11
+ date: 2018-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -170,6 +170,7 @@ files:
170
170
  - spec/sample_response_headers/headers_wetransfer_with_proxy_status.txt
171
171
  - spec/sample_response_headers/headers_wetransfer_with_redirect.txt
172
172
  - spec/sample_response_headers/headers_with_set_cookie.txt
173
+ - spec/sample_response_headers/sample_http2_header.txt
173
174
  - spec/sample_response_headers/webmock_headers_without_trailing_crlf.txt
174
175
  - spec/session_spec.rb
175
176
  - spec/session_ssl_spec.rb
@@ -203,9 +204,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
204
  version: 1.2.0
204
205
  requirements: []
205
206
  rubyforge_project: patron
206
- rubygems_version: 2.5.2
207
+ rubygems_version: 2.6.11
207
208
  signing_key:
208
209
  specification_version: 4
209
210
  summary: Patron HTTP Client
210
211
  test_files: []
211
- has_rdoc: