async-http 0.46.0 → 0.46.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: 354c7fb881a4d777bdf8f19a4c333b832e3bbc81f4dfa7e9851c3aa983d9bc7b
4
- data.tar.gz: 9408b0a577c8162b2479e485e1d098d271717c8f9043a9c1bfa931655b650821
3
+ metadata.gz: 5b7db0313fc3a2dbd5e6e129b383978c401cd8d29d3526a1b04b9f1e51c639fb
4
+ data.tar.gz: d7216cd01e4b8fab066c955bf78f42dacd6e4fa0545c28cdea768b8e136bde33
5
5
  SHA512:
6
- metadata.gz: 709eb4507c6d562ae0eb69594ccb7f77d88d48be7259ac3ed215bb84a4c6e3de252fe9aff141cbbc1bd98e522b2d36442b4ce9dfab715b64a7ded784b00224a1
7
- data.tar.gz: 9d45db2e2e87d3c89da79518ea7c0685b005c8b07ea295b7501a5ec6f093786c35ec6fe7b858d66c0ce57397ab295488694711681a7e7c4b4109ad4a38d6b76a
6
+ metadata.gz: 992e488841e226605b85cf8677df82d26407018e1c6d23c9914e2537b254a25f099e7b3c1d00109c9e507a57ae7a2be78ab34230823b1da7316de73ed316134b
7
+ data.tar.gz: c6c00d4f294a54f3d243534bf207a0a806ddaa83412f39102488f59c0d83094648051f200020011a469acf2da2c83d6701fe065ca0b11e9e019d18c2506b8ec8
@@ -36,8 +36,8 @@ module Async
36
36
  end
37
37
 
38
38
  # @option scheme [String] the scheme to use, overrides the URL scheme.
39
+ # @option hostname [String] the hostname to connect to (or bind to), overrides the URL hostname (used for SNI).
39
40
  # @option port [Integer] the port to bind to, overrides the URL port.
40
- # @option hostname [String] the hostname to use, overrides the URL hostname.
41
41
  # @option ssl_context [OpenSSL::SSL::SSLContext] the context to use for TLS.
42
42
  # @option alpn_protocols [Array<String>] the alpn protocols to negotiate.
43
43
  def initialize(url, endpoint = nil, **options)
@@ -60,7 +60,7 @@ module Async
60
60
  end
61
61
 
62
62
  def to_s
63
- "\#<#{self.class} #{self.to_url}>"
63
+ "\#<#{self.class} #{self.to_url} #{@options}>"
64
64
  end
65
65
 
66
66
  def inspect
@@ -99,6 +99,7 @@ module Async
99
99
  @options[:port] || @url.port || default_port
100
100
  end
101
101
 
102
+ # The hostname is the server we are connecting to:
102
103
  def hostname
103
104
  @options[:hostname] || @url.hostname
104
105
  end
@@ -109,9 +110,9 @@ module Async
109
110
 
110
111
  def authority
111
112
  if default_port?
112
- hostname
113
+ @url.hostname
113
114
  else
114
- "#{hostname}:#{port}"
115
+ "#{@url.hostname}:#{port}"
115
116
  end
116
117
  end
117
118
 
@@ -131,7 +132,7 @@ module Async
131
132
  end
132
133
 
133
134
  def localhost?
134
- self.hostname =~ /^(.*?\.)?localhost\.?$/
135
+ @url.hostname =~ /^(.*?\.)?localhost\.?$/
135
136
  end
136
137
 
137
138
  # We don't try to validate peer certificates when talking to localhost because they would always be self-signed.
@@ -169,13 +170,13 @@ module Async
169
170
  end
170
171
 
171
172
  def build_endpoint(endpoint = nil)
172
- endpoint ||= Async::IO::Endpoint.tcp(hostname, port, tcp_options)
173
+ endpoint ||= Async::IO::Endpoint.tcp(self.hostname, port, tcp_options)
173
174
 
174
175
  if secure?
175
176
  # Wrap it in SSL:
176
177
  return Async::IO::SSLEndpoint.new(endpoint,
177
178
  ssl_context: self.ssl_context,
178
- hostname: self.hostname,
179
+ hostname: @url.hostname,
179
180
  timeout: self.timeout,
180
181
  )
181
182
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.46.0"
23
+ VERSION = "0.46.1"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.46.0
4
+ version: 0.46.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams