excon 0.88.0 → 0.90.0

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: 4833043db3796214dc4c5e339db701b609f0664fe5e3dd24f9c0c69a4e94d3ca
4
- data.tar.gz: 6a2cba5d185ded99cffbf4057ed141ca15993ed409a5bb8059aef83b6d26c680
3
+ metadata.gz: 6514f6e331e286e8c6c8f022eee9e79a9483b28ff9e218aa10ea9e0dd63a1f5c
4
+ data.tar.gz: b58f6111c8f93dd0c5f625e727b065830467d8c61b6880767e878b88642e63bf
5
5
  SHA512:
6
- metadata.gz: 5dc2124ca9454071c435b814a70dff35c2eee0ed7f7f0e90f5cbd7b5705863c7bd8c69ab40f86d626c83672cd94117a7f6b4bf581101d699034bde70be96d93e
7
- data.tar.gz: a9048686e48a21fa494dc09394881fa11ff7a6786bb216e06ceb95530d251e3c04c331f5a2b24e04e60cb08e4a5e7003f6ece127c01dc5a4c71df27361d27a66
6
+ metadata.gz: eb9ca062b32869a3c1ea826f3888f310a4dde0bff6a1bfb85a7c12f7b8efe349027961f0d44ca4f1f67e12711ba586a1c866c70bd45dbf6cad8e99c407312a1d
7
+ data.tar.gz: 0e8897cd518e4e0153681e2e8f05baceb6c4186ce52d8c4bc9128d0622a15506c225505dd4d7cd1252a05d8d000833c44a2a06c5bde7494e30f8a721ac6cf659
data/CONTRIBUTING.md CHANGED
@@ -19,5 +19,4 @@ New contributors are always welcome, when it doubt please ask questions. We stri
19
19
  * Write and help edit [documentation](https://github.com/excon/excon.github.com).
20
20
  * Translate [documentation](https://github.com/excon/excon.github.com) in to other languages.
21
21
  * Organize or volunteer at events.
22
- * [Donate](https://www.gittip.com/geemus/)!
23
22
  * Discuss other ideas for contribution with [geemus](mailto:geemus+excon@gmail.com).
data/excon.gemspec CHANGED
@@ -1,4 +1,5 @@
1
- require File.join(File.dirname(__FILE__), 'lib', 'excon', 'version')
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
2
+ require 'excon/version'
2
3
 
3
4
  Gem::Specification.new do |s|
4
5
  s.name = 'excon'
@@ -2,6 +2,10 @@
2
2
  module Excon
3
3
  module Middleware
4
4
  class Decompress < Excon::Middleware::Base
5
+
6
+ INFLATE_ZLIB_OR_GZIP = 47 # Zlib::MAX_WBITS + 32
7
+ INFLATE_RAW = -15 # Zlib::MAX_WBITS * -1
8
+
5
9
  def request_call(datum)
6
10
  unless datum.has_key?(:response_block)
7
11
  key = datum[:headers].keys.detect {|k| k.to_s.casecmp('Accept-Encoding') == 0 } || 'Accept-Encoding'
@@ -19,8 +23,11 @@ module Excon
19
23
  encodings = Utils.split_header_value(datum[:response][:headers][key])
20
24
  if (encoding = encodings.last)
21
25
  if encoding.casecmp('deflate') == 0
22
- # assume inflate omits header
23
- datum[:response][:body] = Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(body)
26
+ datum[:response][:body] = begin
27
+ Zlib::Inflate.new(INFLATE_ZLIB_OR_GZIP).inflate(body)
28
+ rescue Zlib::DataError # fallback to raw on error
29
+ Zlib::Inflate.new(INFLATE_RAW).inflate(body)
30
+ end
24
31
  encodings.pop
25
32
  elsif encoding.casecmp('gzip') == 0 || encoding.casecmp('x-gzip') == 0
26
33
  datum[:response][:body] = Zlib::GzipReader.new(StringIO.new(body)).read
@@ -54,11 +54,13 @@ module Excon
54
54
  ssl_context.cert_store = cert_store
55
55
  end
56
56
 
57
- # no defaults, fallback to bundled
58
- unless ca_file || ca_path || cert_store
57
+ if cert_store.nil?
59
58
  ssl_context.cert_store = OpenSSL::X509::Store.new
60
59
  ssl_context.cert_store.set_default_paths
60
+ end
61
61
 
62
+ # no defaults, fallback to bundled
63
+ unless ca_file || ca_path || cert_store
62
64
  # workaround issue #257 (JRUBY-6970)
63
65
  ca_file = DEFAULT_CA_FILE
64
66
  ca_file = ca_file.gsub(/^jar:/, '') if ca_file =~ /^jar:file:\//
@@ -4,7 +4,7 @@ module Excon
4
4
  module Server
5
5
  module Puma
6
6
  def start(app_str = app, bind_uri = bind)
7
- open_process('puma', '-b', bind_uri.to_s, app_str)
7
+ open_process(RbConfig.ruby, '-S', 'puma', '-b', bind_uri.to_s, app_str)
8
8
  process_stderr = ""
9
9
  line = ''
10
10
  until line =~ /Use Ctrl-C to stop/
@@ -13,6 +13,8 @@ module Excon
13
13
  bind_str = "#{host}:#{bind_uri.port}"
14
14
  end
15
15
  args = [
16
+ RbConfig.ruby,
17
+ '-S',
16
18
  'unicorn',
17
19
  '--no-default-middleware',
18
20
  '-l',
@@ -7,7 +7,7 @@ module Excon
7
7
  bind_uri = URI.parse(bind_uri) unless bind_uri.is_a? URI::Generic
8
8
  host = bind_uri.host.gsub(/[\[\]]/, '')
9
9
  port = bind_uri.port.to_s
10
- open_process('rackup', '-s', 'webrick', '--host', host, '--port', port, app_str)
10
+ open_process(RbConfig.ruby, '-S', 'rackup', '-s', 'webrick', '--host', host, '--port', port, app_str)
11
11
  process_stderr = ""
12
12
  line = ''
13
13
  until line =~ /HTTPServer#start/
data/lib/excon/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Excon
3
- VERSION = '0.88.0'
3
+ VERSION = '0.90.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.88.0
4
+ version: 0.90.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dpiddy (Dan Peterson)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-10-27 00:00:00.000000000 Z
13
+ date: 2022-01-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec