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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cf89a26a83c77e1de102c5281a142ef68883f7f5a3b6074deddc4b4699c4b75
4
- data.tar.gz: b3e1cf4e374db9a2e4ad7e909151b1914c5dcb9503f25000b5bb66e08766114e
3
+ metadata.gz: e4bdbc0cd6c6f9f448467ce9852c4f0fc75f42be7a23c30d4e21cb15ed943852
4
+ data.tar.gz: fff901df109eeddcea4186d8874414e5bfb71d2b6bae43820c3573b674dec6ab
5
5
  SHA512:
6
- metadata.gz: 7871ee50c8e327317c41d604217e2e8fbecb62930adba09d7b53e3ad9268cfd9deb07cbaccb8f33ee62e080d000cb6d72ea6251213d40ab6e5baf224d10af819
7
- data.tar.gz: afa1bf96c6fca1142c4d1e60e4e5af1256d891e8c3c8abe0a5ae06d1c07eb2a796d95aa2c59d266343c7dab6e97b83e345663214f21579f22d068d48a9d83752
6
+ metadata.gz: 4f250597779464a2a1637163e3bb19178e202e06d02075d7b59e67d1ae73e3a7836794782eb727182e54455d5a9512d0f196ebf02476007859daa0281386f6c0
7
+ data.tar.gz: 7bd0df3633514ad9d3932c17f4eda4791b9ed164bd492b091a77a7bbe9b396e5fb3efcf3d95cd3de039cb91a6674dd244a79e890d182792430f8a90e5312ae01
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## sentofu 0.4.1 released 2019-07-26
6
+
7
+ * Refine 'sentofu_http_proxy' parsing
8
+
9
+
5
10
  ## sentofu 0.4.0 released 2019-07-26
6
11
 
7
12
  * Accept `ENV['sentofu_http_proxy']`
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[5], pm[7] ? pm[7].to_i : nil, # proxy host and port
38
- pm[2], pm[4]) # proxy user and pass
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
@@ -14,7 +14,7 @@ require 'sentofu/explo'
14
14
 
15
15
  module Sentofu
16
16
 
17
- VERSION = '0.4.0'
17
+ VERSION = '0.4.1'
18
18
 
19
19
  USER_AGENT =
20
20
  "Sentofu #{Sentofu::VERSION} - " +
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.0
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-25 00:00:00.000000000 Z
11
+ date: 2019-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec