httpi 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG.md +14 -1
- data/lib/httpi.rb +2 -2
- data/lib/httpi/adapter/net_http.rb +2 -3
- data/lib/httpi/response.rb +2 -0
- data/lib/httpi/version.rb +1 -1
- data/spec/httpi/adapter/net_http_spec.rb +3 -4
- metadata +5 -19
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NTg1OTVkMjUyODliYTU2NTE1YTk4ZTVmM2MwODczOTM2YWIyN2VmNg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NWJhMGMyMzljNmUxNGNlYWE1OTllNWNhZDhiNTgwNjAxNDJjMmIyNg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDQ4MjVjMWUxNzZiOWViMWY1YjJkZTZlOWQ1ZDRjNWM0NTlmNWM3MDA3NWU1
|
10
|
+
N2Q2M2EzMDE5Nzc5MDAxZWMyZGFlZjM1NDM0NTQxNzM1YzVjOWUxZTYxZWRk
|
11
|
+
Njc4NmM1ZWQxNmYwMzU2NjkzY2I1NzYzMTA5NGFhZjU4Mjg3Y2E=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MzM3ZjZmOWJhOWNmZjgwMTA0MzcxZmJiNjQ1MDlmODk1MjlmN2Q3MWU4YWNj
|
14
|
+
NzNhMDYyNzJjZGQxNGU2ZGYwZDEyMDdiYjI5ZDc4M2RhOTI1MTE0Mjc2NGY4
|
15
|
+
NTU5YWRmYjFkODc1MWFkOWU3NTYxMzhkNzJjYWU5ZTQwYTE0Yzg=
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,17 @@
|
|
1
|
-
### 2.2.
|
1
|
+
### 2.2.5
|
2
|
+
|
3
|
+
* Feature: [#123](https://github.com/savonrb/httpi/pull/123) Don't warn about missing rubyntlm gem if it is optional. Thanks to [PChambino](https://github.com/PChambino)
|
4
|
+
|
5
|
+
### 2.2.4
|
6
|
+
|
7
|
+
* Fix: [#120](https://github.com/savonrb/httpi/pull/120) fixed an unintended crash when an incompatible version of NTLM was required. Thanks to [hubrix](https://github.com/hubrix)
|
8
|
+
|
9
|
+
### 2.2.3
|
10
|
+
|
11
|
+
* Feature: [#117](https://github.com/savonrb/httpi/pull/117) Follow 302 redirects
|
12
|
+
* Feature: [#118](https://github.com/savonrb/httpi/pull/118) Support for SSL certificate private keys in formats other than RSA
|
13
|
+
|
14
|
+
### 2.2.2
|
2
15
|
|
3
16
|
* Feature: [#118](https://github.com/savonrb/httpi/pull/118) Support for other SSL certificate keys, not only RSA. Thanks to [Novikov Andrey](https://github.com/Envek).
|
4
17
|
|
data/lib/httpi.rb
CHANGED
@@ -138,8 +138,8 @@ module HTTPI
|
|
138
138
|
|
139
139
|
response = adapter_class.request(method)
|
140
140
|
|
141
|
-
if response
|
142
|
-
log(
|
141
|
+
if response && HTTPI::Response::RedirectResponseCodes.member?(response.code) && request.follow_redirect?
|
142
|
+
log("Following redirect: '#{response.headers['location']}'.")
|
143
143
|
request.url = response.headers['location']
|
144
144
|
return request(method, request, adapter)
|
145
145
|
end
|
@@ -11,8 +11,7 @@ begin
|
|
11
11
|
unless Net::NTLM::VERSION::STRING >= '0.3.2'
|
12
12
|
raise ArgumentError, 'Invalid version of rubyntlm. Please use v0.3.2+.'
|
13
13
|
end
|
14
|
-
rescue LoadError
|
15
|
-
HTTPI.logger.debug('Net::NTLM is not available. Install via gem install rubyntlm.')
|
14
|
+
rescue LoadError
|
16
15
|
end
|
17
16
|
|
18
17
|
module HTTPI
|
@@ -86,7 +85,7 @@ module HTTPI
|
|
86
85
|
|
87
86
|
def negotiate_ntlm_auth(http, &requester)
|
88
87
|
unless Net.const_defined?(:NTLM)
|
89
|
-
|
88
|
+
raise NotSupportedError, 'Net::NTLM is not available. Install via gem install rubyntlm.'
|
90
89
|
end
|
91
90
|
|
92
91
|
# first figure out if we should use NTLM or Negotiate
|
data/lib/httpi/response.rb
CHANGED
@@ -14,6 +14,8 @@ module HTTPI
|
|
14
14
|
|
15
15
|
# Range of HTTP response codes considered to be successful.
|
16
16
|
SuccessfulResponseCodes = 200..299
|
17
|
+
# HTTP response codes considered to be a redirect.
|
18
|
+
RedirectResponseCodes = [301, 302, 303, 307, 308]
|
17
19
|
|
18
20
|
# Initializer expects an HTTP response +code+, +headers+ and +body+.
|
19
21
|
def initialize(code, headers, body)
|
data/lib/httpi/version.rb
CHANGED
@@ -76,15 +76,14 @@ describe HTTPI::Adapter::NetHTTP do
|
|
76
76
|
expect(response.body).to eq("ntlm-auth")
|
77
77
|
end
|
78
78
|
|
79
|
-
it '
|
79
|
+
it 'does not support ntlm authentication when Net::NTLM is not available' do
|
80
80
|
Net.expects(:const_defined?).with(:NTLM).returns false
|
81
81
|
|
82
82
|
request = HTTPI::Request.new(@server.url + 'ntlm-auth')
|
83
83
|
request.auth.ntlm("testing", "failures")
|
84
|
-
HTTPI.logger.expects(:fatal)
|
85
84
|
|
86
|
-
|
87
|
-
|
85
|
+
expect { HTTPI.get(request, adapter) }.
|
86
|
+
to raise_error(HTTPI::NotSupportedError, /Net::NTLM is not available/)
|
88
87
|
end
|
89
88
|
end
|
90
89
|
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.2.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Daniel Harrington
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2014-
|
12
|
+
date: 2014-08-03 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rack
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ! '>='
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ! '>='
|
29
26
|
- !ruby/object:Gem::Version
|
@@ -31,7 +28,6 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rubyntlm
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
32
|
- - ~>
|
37
33
|
- !ruby/object:Gem::Version
|
@@ -39,7 +35,6 @@ dependencies:
|
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
39
|
- - ~>
|
45
40
|
- !ruby/object:Gem::Version
|
@@ -47,7 +42,6 @@ dependencies:
|
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: rake
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
46
|
- - ~>
|
53
47
|
- !ruby/object:Gem::Version
|
@@ -55,7 +49,6 @@ dependencies:
|
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
53
|
- - ~>
|
61
54
|
- !ruby/object:Gem::Version
|
@@ -63,7 +56,6 @@ dependencies:
|
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: rspec
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
60
|
- - ~>
|
69
61
|
- !ruby/object:Gem::Version
|
@@ -71,7 +63,6 @@ dependencies:
|
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
67
|
- - ~>
|
77
68
|
- !ruby/object:Gem::Version
|
@@ -79,7 +70,6 @@ dependencies:
|
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: mocha
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
74
|
- - ~>
|
85
75
|
- !ruby/object:Gem::Version
|
@@ -87,7 +77,6 @@ dependencies:
|
|
87
77
|
type: :development
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
81
|
- - ~>
|
93
82
|
- !ruby/object:Gem::Version
|
@@ -95,7 +84,6 @@ dependencies:
|
|
95
84
|
- !ruby/object:Gem::Dependency
|
96
85
|
name: puma
|
97
86
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
87
|
requirements:
|
100
88
|
- - ~>
|
101
89
|
- !ruby/object:Gem::Version
|
@@ -103,7 +91,6 @@ dependencies:
|
|
103
91
|
type: :development
|
104
92
|
prerelease: false
|
105
93
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
94
|
requirements:
|
108
95
|
- - ~>
|
109
96
|
- !ruby/object:Gem::Version
|
@@ -183,26 +170,25 @@ files:
|
|
183
170
|
homepage: http://github.com/savonrb/#{s.name}
|
184
171
|
licenses:
|
185
172
|
- MIT
|
173
|
+
metadata: {}
|
186
174
|
post_install_message:
|
187
175
|
rdoc_options: []
|
188
176
|
require_paths:
|
189
177
|
- lib
|
190
178
|
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
-
none: false
|
192
179
|
requirements:
|
193
180
|
- - ! '>='
|
194
181
|
- !ruby/object:Gem::Version
|
195
182
|
version: '0'
|
196
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
|
-
none: false
|
198
184
|
requirements:
|
199
185
|
- - ! '>='
|
200
186
|
- !ruby/object:Gem::Version
|
201
187
|
version: '0'
|
202
188
|
requirements: []
|
203
189
|
rubyforge_project: httpi
|
204
|
-
rubygems_version:
|
190
|
+
rubygems_version: 2.0.3
|
205
191
|
signing_key:
|
206
|
-
specification_version:
|
192
|
+
specification_version: 4
|
207
193
|
summary: Common interface for Ruby's HTTP libraries
|
208
194
|
test_files: []
|