Skip to content

Commit 7611e41

Browse files
committed
fix: don't interrupt requests if proxy is without authentication
1 parent aa766c8 commit 7611e41

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/capybara/cuprite/driver.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ def set_proxy(host, port, user = nil, password = nil, bypass = nil)
209209
@options[:browser_options] ||= {}
210210
@options[:browser_options].merge!("proxy-server" => "#{host}:#{port}")
211211
@options[:browser_options].merge!("proxy-bypass-list" => bypass) if bypass
212-
browser.network.authorize(type: :proxy, user: user, password: password) do |request, _index, _total|
212+
213+
return unless user && password
214+
215+
browser.network.authorize(user: user, password: password, type: :proxy) do |request, _index, _total|
213216
request.continue
214217
end
215218
end

0 commit comments

Comments
 (0)