Commit b963018e authored by Jacob Vosmaer's avatar Jacob Vosmaer

Actually use the read_timeout config option

parent 08c8f308
...@@ -73,7 +73,7 @@ class GitlabNet ...@@ -73,7 +73,7 @@ class GitlabNet
http = Net::HTTP.new(uri.host, uri.port) http = Net::HTTP.new(uri.host, uri.port)
end end
http.read_timeout = options[:read_timeout] || READ_TIMEOUT http.read_timeout = options[:read_timeout] || read_timeout
if uri.is_a?(URI::HTTPS) if uri.is_a?(URI::HTTPS)
http.use_ssl = true http.use_ssl = true
...@@ -154,4 +154,8 @@ class GitlabNet ...@@ -154,4 +154,8 @@ class GitlabNet
def secret_token def secret_token
@secret_token ||= File.read config.secret_file @secret_token ||= File.read config.secret_file
end end
def read_timeout
config.http_settings['read_timeout'] || READ_TIMEOUT
end
end end
...@@ -143,7 +143,7 @@ describe GitlabNet, vcr: true do ...@@ -143,7 +143,7 @@ describe GitlabNet, vcr: true do
subject { gitlab_net.send :http_client_for, URI('https://localhost/') } subject { gitlab_net.send :http_client_for, URI('https://localhost/') }
before do before do
gitlab_net.stub! :cert_store gitlab_net.stub! :cert_store
gitlab_net.send(:config).http_settings.stub(:[]).with('self_signed_cert') { true } gitlab_net.send(:config).stub(:http_settings) { {'self_signed_cert' => true} }
end end
its(:verify_mode) { should eq(OpenSSL::SSL::VERIFY_NONE) } its(:verify_mode) { should eq(OpenSSL::SSL::VERIFY_NONE) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment