excon 0.88.0 → 0.89.0

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
  SHA256:
3
- metadata.gz: 4833043db3796214dc4c5e339db701b609f0664fe5e3dd24f9c0c69a4e94d3ca
4
- data.tar.gz: 6a2cba5d185ded99cffbf4057ed141ca15993ed409a5bb8059aef83b6d26c680
3
+ metadata.gz: b3a57a3993c964d75919bca21514d9fa468b81f5f881e0bd13371a043687dbcf
4
+ data.tar.gz: 2f6a69237fef2977a4a4e897b4d49a537a781231911df715dce4206621691d42
5
5
  SHA512:
6
- metadata.gz: 5dc2124ca9454071c435b814a70dff35c2eee0ed7f7f0e90f5cbd7b5705863c7bd8c69ab40f86d626c83672cd94117a7f6b4bf581101d699034bde70be96d93e
7
- data.tar.gz: a9048686e48a21fa494dc09394881fa11ff7a6786bb216e06ceb95530d251e3c04c331f5a2b24e04e60cb08e4a5e7003f6ece127c01dc5a4c71df27361d27a66
6
+ metadata.gz: 497c4422d1684e6ae7c73a189027632f326e4dd519ff074d56e4ad9eabf8af944d9f845dd69af236369186cee2046211867ea2b5007a950298065d8e488ee7a9
7
+ data.tar.gz: ff964c1ba620bed15541efb97600f42b8e4cea7ec22290c3b11bfc7ae129026d2ec906fe013647f120cb8a6c87b7f0fb0dde3d9b9383929a92cf288d2710dbc0
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
@@ -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.89.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.89.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: 2021-12-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec