http-client 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/README.md +5 -0
- data/lib/http/client.rb +11 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f0bd131d91055ba88ef419e2320e73f7c22a736
|
4
|
+
data.tar.gz: 921c11271d7aaebc44df64c5f40fa04de5f6c084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ba43b3fe0dd4c2cfb45c7a5095597b88e3da82d032e9795990a9cef3ab6e606c135457cd8093b05e02986fdba0369637d993fa8196c1312184bfebed47083d2
|
7
|
+
data.tar.gz: 871bbed57899b5e40bc42715f3068a5368c2baf04a485796a0e2cc04633633439d7ac38fcce4f2edde473995015a0610111751d888f9c474af5b4763824e50f7
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
data/lib/http/client.rb
CHANGED
@@ -9,7 +9,7 @@ require 'zlib'
|
|
9
9
|
|
10
10
|
module HTTP
|
11
11
|
module Client
|
12
|
-
VERSION = '0.
|
12
|
+
VERSION = '0.6.0'
|
13
13
|
|
14
14
|
GET = Net::HTTP::Get
|
15
15
|
HEAD = Net::HTTP::Head
|
@@ -22,6 +22,10 @@ module HTTP
|
|
22
22
|
SSL_VERIFY_NONE = OpenSSL::SSL::VERIFY_NONE
|
23
23
|
SSL_VERIFY_PEER = OpenSSL::SSL::VERIFY_PEER
|
24
24
|
|
25
|
+
class << self
|
26
|
+
attr_accessor :open_timeout, :ssl_timeout, :read_timeout
|
27
|
+
end
|
28
|
+
|
25
29
|
class Request
|
26
30
|
VALID_PARAMETERS = %w(headers files query body auth timeout open_timeout ssl_timeout read_timeout max_redirects ssl_verify jar)
|
27
31
|
DEFAULT_HEADERS = {'User-Agent' => 'HTTP Client API/1.0'}
|
@@ -100,17 +104,21 @@ module HTTP
|
|
100
104
|
@delegate.basic_auth(uri.user, uri.password)
|
101
105
|
end
|
102
106
|
|
107
|
+
@open_timeout = HTTP::Client.open_timeout
|
108
|
+
@read_timeout = HTTP::Client.read_timeout
|
109
|
+
@ssl_timeout = HTTP::Client.ssl_timeout
|
110
|
+
|
103
111
|
# generic timeout
|
104
112
|
if timeout = args[:timeout]
|
105
113
|
@open_timeout = timeout
|
106
|
-
@ssl_timeout = timeout
|
107
114
|
@read_timeout = timeout
|
115
|
+
@ssl_timeout = timeout
|
108
116
|
end
|
109
117
|
|
110
118
|
# overrides
|
111
119
|
@open_timeout = args[:open_timeout] if args[:open_timeout]
|
112
|
-
@ssl_timeout = args[:ssl_timeout] if args[:ssl_timeout]
|
113
120
|
@read_timeout = args[:read_timeout] if args[:read_timeout]
|
121
|
+
@ssl_timeout = args[:ssl_timeout] if args[:ssl_timeout]
|
114
122
|
|
115
123
|
@max_redirects = args.fetch(:max_redirects, 0)
|
116
124
|
@ssl_verify = args.fetch(:ssl_verify, SSL_VERIFY_PEER)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bharanee Rathna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|