excon 0.88.0 → 0.90.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +0 -1
- data/excon.gemspec +2 -1
- data/lib/excon/middlewares/decompress.rb +9 -2
- data/lib/excon/ssl_socket.rb +4 -2
- data/lib/excon/test/plugin/server/puma.rb +1 -1
- data/lib/excon/test/plugin/server/unicorn.rb +2 -0
- data/lib/excon/test/plugin/server/webrick.rb +1 -1
- data/lib/excon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6514f6e331e286e8c6c8f022eee9e79a9483b28ff9e218aa10ea9e0dd63a1f5c
|
4
|
+
data.tar.gz: b58f6111c8f93dd0c5f625e727b065830467d8c61b6880767e878b88642e63bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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
|
data/lib/excon/ssl_socket.rb
CHANGED
@@ -54,11 +54,13 @@ module Excon
|
|
54
54
|
ssl_context.cert_store = cert_store
|
55
55
|
end
|
56
56
|
|
57
|
-
|
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/
|
@@ -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.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:
|
13
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|