nice_http 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/nice_http.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cffd946cebf53c5c36b4c5ec3a6d242884133e84f383571ad9474132b8de042b
|
4
|
+
data.tar.gz: 8fc3fa195125d78c4aa933c141cee357618274391e3f9e0a79f56e6e6aadf4d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 400df088538e0f5d53b5e2db525d411498c70336fe5adcca2cd7ee8bc06805e07729270bfc54550ae22e828e7818a6adab54ce50d2c86388f0eae56a970be3b0
|
7
|
+
data.tar.gz: 4d4ab9ab1ae81843bebfa3013643c874777f5882340946753d528a5fe87554b21e18177c720147ced90a95928cab8a32ea8679cb90608373a9d69e660f6f3ae0
|
data/README.md
CHANGED
@@ -62,7 +62,7 @@ http3 = NiceHttp.new my_reqres_server
|
|
62
62
|
```
|
63
63
|
|
64
64
|
|
65
|
-
You can specify all the defaults you will be using when creating connections by using the NiceHttp methods, in this example, http1 and http2 will be connecting to
|
65
|
+
You can specify all the defaults you will be using when creating connections by using the NiceHttp methods, in this example, http1 and http2 will be connecting to reqres.in and http3 to example.com:
|
66
66
|
|
67
67
|
```ruby
|
68
68
|
|
data/lib/nice_http.rb
CHANGED
@@ -102,6 +102,13 @@ class NiceHttp
|
|
102
102
|
@auto_redirect = args[:auto_redirect] if args.keys.include?(:auto_redirect)
|
103
103
|
end
|
104
104
|
|
105
|
+
if @host.include?("http:") or @host.include?("https:")
|
106
|
+
uri = URI.parse(@host)
|
107
|
+
@host = uri.host unless uri.host.nil?
|
108
|
+
@port = uri.port unless uri.port.nil?
|
109
|
+
@ssl = true if !uri.scheme.nil? && (uri.scheme == 'https')
|
110
|
+
end
|
111
|
+
|
105
112
|
if !@proxy_host.nil? && !@proxy_port.nil?
|
106
113
|
@http = Net::HTTP::Proxy(@proxy_host, @proxy_port).new(@host, @port)
|
107
114
|
@http.use_ssl = @ssl
|