From 449f0ae47ddc8de099d11632093ab09f547ffd61 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Thu, 20 Sep 2018 08:56:35 -0700 Subject: [PATCH] Add Errno::ECONNRESET to the errors that trigger https attempt --- lib/capybara/server/checker.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/capybara/server/checker.rb b/lib/capybara/server/checker.rb index e9285404..7189475b 100644 --- a/lib/capybara/server/checker.rb +++ b/lib/capybara/server/checker.rb @@ -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