http-client 0.2.1 → 0.2.2
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/lib/http/client.rb +2 -2
- data/test/test_request.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bd3c5c6c67b68ab191ee00c5dcdcb75b5a4549e
|
4
|
+
data.tar.gz: 5bbbcb5bab7c3bedf0b670f73b836803437e89c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aba36be8c66578583270f7cd2e71f105a37a8c5af8d6cb3585c35795af02a6be32f39d51178bbdb53d35922389ea6fd6ea2874b33dbe3f27e8b31e43772b7413
|
7
|
+
data.tar.gz: 05e2370d9f6c65885ef2adc18087e209a35dceebe44b567b737821903b882233c5e79342297b97665116a7e462e01f8ceab2d60a4b0fb083a616b226ca45e7d3
|
data/CHANGELOG
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.2.
|
12
|
+
VERSION = '0.2.2'
|
13
13
|
|
14
14
|
GET = Net::HTTP::Get
|
15
15
|
HEAD = Net::HTTP::Head
|
@@ -158,7 +158,7 @@ module HTTP
|
|
158
158
|
raise ArgumentError, "Invalid URI #{uri}" if uri.host.nil?
|
159
159
|
uri
|
160
160
|
when URI::Generic
|
161
|
-
if @delegate.uri
|
161
|
+
if @delegate && @delegate.uri
|
162
162
|
@delegate.uri.dup.tap {|s| s += uri }
|
163
163
|
else
|
164
164
|
raise ArgumentError, "Invalid URI #{uri}"
|
data/test/test_request.rb
CHANGED
@@ -6,6 +6,7 @@ describe 'HTTP Client Request' do
|
|
6
6
|
it 'should reject invalid arguments' do
|
7
7
|
assert_raises(HTTP::Client::ArgumentError, 'invalid verb') {HTTP::Client::Request.new(:foo, 'http://example.org/')}
|
8
8
|
assert_raises(HTTP::Client::ArgumentError, 'invalid uri') {HTTP::Client::Request.new(:get, 'http://')}
|
9
|
+
assert_raises(HTTP::Client::ArgumentError, 'invalid uri') {HTTP::Client::Request.new(:get, '/hello')}
|
9
10
|
|
10
11
|
assert_raises(HTTP::Client::ArgumentError, 'invalid argument') do
|
11
12
|
HTTP::Client::Request.new(:get, 'http://example.org/', foo: 1)
|