excon 0.88.0 → 0.89.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3a57a3993c964d75919bca21514d9fa468b81f5f881e0bd13371a043687dbcf
|
4
|
+
data.tar.gz: 2f6a69237fef2977a4a4e897b4d49a537a781231911df715dce4206621691d42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 497c4422d1684e6ae7c73a189027632f326e4dd519ff074d56e4ad9eabf8af944d9f845dd69af236369186cee2046211867ea2b5007a950298065d8e488ee7a9
|
7
|
+
data.tar.gz: ff964c1ba620bed15541efb97600f42b8e4cea7ec22290c3b11bfc7ae129026d2ec906fe013647f120cb8a6c87b7f0fb0dde3d9b9383929a92cf288d2710dbc0
|
data/excon.gemspec
CHANGED
@@ -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
|
-
|
23
|
-
|
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/
|
@@ -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
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.
|
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-
|
13
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|