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:
parent
7f4b960115
commit
449f0ae47d
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue