http-client 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -0
  3. data/lib/http/client.rb +7 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d546e0cdecec14e9d20d4b95c21bd149602b3c12
4
- data.tar.gz: c564d50a791ce9244b199276c9e7b7b55e843127
3
+ metadata.gz: 1f4a112248d92e2509e0216202710ecf2f4b7d0e
4
+ data.tar.gz: 79dacb1979e38cdcd9e56595e06d9d7e5faaabd1
5
5
  SHA512:
6
- metadata.gz: d76ba488f562a71c3335f87b59848f8ab51a5e179e9cdbd682b5e075ebf72361736aa34f620677602d8f7fda62738cbd1dd774c7d310a87839507fbd82b55c27
7
- data.tar.gz: fd787d6c479ae7acf074a88a493e38c5ed6bf975a91954d1ed50772bd84c568ea2a029337a5c41c5dd912a8c9d9728f6301b7d36d4bfcc4b303ac31e1db696aa
6
+ metadata.gz: 884c171d1b1329d12542601a2380e9079dd2eb52c0e92620d51810d6789b8c803c6bf2c2e244f80b21c34b3ec6d9ab229a7632340cb5491cfdbda54de0d84ea9
7
+ data.tar.gz: 39f076f5abcf0b6a5cde2400be1c4c3b33f3447c956e01f46855fef49d4d85fc1a9f27cae4bd2a00ea9f0f3cc7c238bcab897cc160d41dcafe4dedf9a2bfaa28
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.5.0 (2018-08-20)
2
+
3
+ * Handle basic auth credentials passed in URI.
4
+
1
5
  == 0.4.0 (2017-07-05)
2
6
 
3
7
  * Cleanup error classes namespacing.
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.4.0'
12
+ VERSION = '0.5.0'
13
13
 
14
14
  GET = Net::HTTP::Get
15
15
  HEAD = Net::HTTP::Head
@@ -90,10 +90,16 @@ module HTTP
90
90
  @delegate.body = body
91
91
  end
92
92
 
93
+ # if auth is passed as arguments.
93
94
  if auth = args[:auth]
94
95
  @delegate.basic_auth(auth.fetch(:username), auth.fetch(:password))
95
96
  end
96
97
 
98
+ # if auth is passed in uri.
99
+ if uri.user && uri.password
100
+ @delegate.basic_auth(uri.user, uri.password)
101
+ end
102
+
97
103
  # generic timeout
98
104
  if timeout = args[:timeout]
99
105
  @open_timeout = timeout
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.0
4
+ version: 0.5.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: 2017-07-05 00:00:00.000000000 Z
11
+ date: 2018-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.6.11
127
+ rubygems_version: 2.5.1
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: A client wrapper around Net::HTTP