1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Add Errno::ECONNRESET to the errors that trigger https attempt

This commit is contained in:
Thomas Walpole 2018-09-20 08:56:35 -07:00
parent 7f4b960115
commit 449f0ae47d

View file

@ -3,6 +3,8 @@
module Capybara module Capybara
class Server class Server
class Checker class Checker
TRY_HTTPS_ERRORS = [EOFError, Net::ReadTimeout, Errno::ECONNRESET].freeze
def initialize(host, port) def initialize(host, port)
@host, @port = host, port @host, @port = host, port
@ssl = false @ssl = false
@ -10,7 +12,7 @@ module Capybara
def request(&block) def request(&block)
ssl? ? https_request(&block) : http_request(&block) ssl? ? https_request(&block) : http_request(&block)
rescue EOFError, Net::ReadTimeout rescue *TRY_HTTPS_ERRORS
res = https_request(&block) res = https_request(&block)
@ssl = true @ssl = true
res res