sentofu 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/sentofu/http.rb +8 -4
- data/lib/sentofu.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4bdbc0cd6c6f9f448467ce9852c4f0fc75f42be7a23c30d4e21cb15ed943852
|
4
|
+
data.tar.gz: fff901df109eeddcea4186d8874414e5bfb71d2b6bae43820c3573b674dec6ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f250597779464a2a1637163e3bb19178e202e06d02075d7b59e67d1ae73e3a7836794782eb727182e54455d5a9512d0f196ebf02476007859daa0281386f6c0
|
7
|
+
data.tar.gz: 7bd0df3633514ad9d3932c17f4eda4791b9ed164bd492b091a77a7bbe9b396e5fb3efcf3d95cd3de039cb91a6674dd244a79e890d182792430f8a90e5312ae01
|
data/CHANGELOG.md
CHANGED
data/lib/sentofu/http.rb
CHANGED
@@ -3,6 +3,8 @@ module Sentofu
|
|
3
3
|
|
4
4
|
module Http
|
5
5
|
|
6
|
+
PROXY_REX = /\A(https?:\/\/)?(([^:@]+)(:([^@]+))?@)?([^:]+)(:(\d+))?\z/
|
7
|
+
|
6
8
|
class << self
|
7
9
|
|
8
10
|
def fetch_token(credentials=nil)
|
@@ -26,16 +28,18 @@ module Sentofu
|
|
26
28
|
request(uri, make_get_req(uri, token))
|
27
29
|
end
|
28
30
|
|
29
|
-
PROXY_REX = /\A(([^:@]+)(:([^@]+))?@)?([^:]+)(:(\d+))?\z/
|
30
|
-
|
31
31
|
def make_net_http(uri)
|
32
32
|
|
33
33
|
http =
|
34
34
|
if pm = PROXY_REX.match(ENV['sentofu_http_proxy'] || '')
|
35
|
+
|
36
|
+
port = m[8] ? m[8].to_i : nil
|
37
|
+
port ||= 443 if m[1] && m[1] == 'https://'
|
38
|
+
|
35
39
|
Net::HTTP.new(
|
36
40
|
uri.host, uri.port,
|
37
|
-
pm[
|
38
|
-
pm[
|
41
|
+
pm[6], port, # proxy host and port
|
42
|
+
pm[3], pm[5]) # proxy user and pass
|
39
43
|
else
|
40
44
|
Net::HTTP.new(
|
41
45
|
uri.host, uri.port)
|
data/lib/sentofu.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentofu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mettraux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|