Skip to content

Commit 3a6712b

Browse files
leksitoa.sadounikau
andauthored
change connopt.https when redirect (#335)
Co-authored-by: a.sadounikau <[email protected]>
1 parent 907f467 commit 3a6712b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/em-http/http_connection.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def redirect(client, new_location)
192192
conn = HttpConnection.new
193193
client.conn = conn
194194
conn.connopts = @connopts
195+
conn.connopts.https = new_location.scheme == "https"
195196
conn.uri = client.req.uri
196197
conn.activate_connection(client)
197198

lib/em-http/http_connection_options.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class HttpConnectionOptions
22
attr_reader :host, :port, :tls, :proxy, :bind, :bind_port
33
attr_reader :connect_timeout, :inactivity_timeout
4+
attr_writer :https
45

56
def initialize(uri, options)
67
@connect_timeout = options[:connect_timeout] || 5 # default connection setup timeout

0 commit comments

Comments
 (0)