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