excon 0.95.0 → 0.97.0

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: f7bc43cec6bb34b6bc06c7bd894427cbfe40ef6d58ea59b5e2b6b4e66fc7136b
4
- data.tar.gz: 02b4a808674b90b0f65ef0dca0a860831371765cb093f42793e74a7108245ec0
3
+ metadata.gz: 8ff4a50f4dfd31750a4ca2f5acb3453a98cbc8b8f15645d426ff414755b021cb
4
+ data.tar.gz: 336a29208217d6ce3d5fe791b3f59e4d34cba8a4ab441f0a9526fd5bd2a848a2
5
5
  SHA512:
6
- metadata.gz: ac6e939c6c9a99fa8f36b841f862c99f70f871e911c8180cc5be45d44f175c2fb54320b64bffa64d8b565d71a3997127a5d9aa661373d4b9a61f4f7becb3bc6e
7
- data.tar.gz: 76d901fe183686d22c3cd727406f4cef1ed29714d75f7338567e4a886a7549255ba3dd45cc1ee9fae9ff2c80a261a17b72f891da7d2473f55c25be8f8c1abe5f
6
+ metadata.gz: ccfae843569c9f02b15ef9ecdc003ff7d85bef3f4d909b541c537e82e58c374ce2b1209c2ccff3d3366e2544d12b970e9014b0cf5c73165f5a7765b3da146d06
7
+ data.tar.gz: 70983a6be372db8daa48e38c0ea462f924e9a46e7d3e065b12297f63bf01f42d02dcd07affdae85c34afa6dc885416f1a78bb147f2115c813fd1053b997017e8
@@ -89,7 +89,9 @@ module Excon
89
89
  end
90
90
 
91
91
  if @data[:scheme] == UNIX
92
- if @data[:host]
92
+ # 'uri' >= v0.12.0 returns an empty string instead of nil for no host.
93
+ # So treat the parameter as present if and only if it is both non-nill and non-empty.
94
+ if @data[:host] && !@data[:host].empty?
93
95
  raise ArgumentError, "The `:host` parameter should not be set for `unix://` connections.\n" +
94
96
  "When supplying a `unix://` URI, it should start with `unix:/` or `unix:///`."
95
97
  elsif !@data[:socket]
@@ -577,6 +579,8 @@ module Excon
577
579
  raise ArgumentError, "The `:ssl_proxy_headers` parameter should only be used with HTTPS requests."
578
580
  end
579
581
  if @data[:proxy][:scheme] == UNIX
582
+ # URI.parse might return empty string for security reasons.
583
+ @data[:proxy][:host] = nil if @data[:proxy][:host] == ""
580
584
  if @data[:proxy][:host]
581
585
  raise ArgumentError, "The `:host` parameter should not be set for `unix://` proxies.\n" +
582
586
  "When supplying a `unix://` URI, it should start with `unix:/` or `unix:///`."
@@ -20,15 +20,24 @@ module Excon
20
20
  def host
21
21
  @data[:host]
22
22
  end
23
+ def scheme
24
+ @data[:scheme]
25
+ end
23
26
  def local_address
24
27
  @data[:local_address]
25
28
  end
26
29
  def local_port
27
30
  @data[:local_port]
28
31
  end
32
+ def http_method # can't be named "method"
33
+ @data[:method]
34
+ end
29
35
  def path
30
36
  @data[:path]
31
37
  end
38
+ def query
39
+ @data[:query]
40
+ end
32
41
  def port
33
42
  @data[:port]
34
43
  end
@@ -72,8 +81,11 @@ module Excon
72
81
  :body => String.new,
73
82
  :cookies => [],
74
83
  :host => datum[:host],
84
+ :scheme => datum[:scheme],
85
+ :method => datum[:method],
75
86
  :headers => Excon::Headers.new,
76
87
  :path => datum[:path],
88
+ :query => datum[:query],
77
89
  :port => datum[:port],
78
90
  :status => status,
79
91
  :status_line => line,
data/lib/excon/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Excon
3
- VERSION = '0.95.0'
3
+ VERSION = '0.97.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.95.0
4
+ version: 0.97.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dpiddy (Dan Peterson)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-12-12 00:00:00.000000000 Z
13
+ date: 2023-01-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec