Skip to content

Commit 3d13cc2

Browse files
committed
Adjust proxy
1 parent 72b8ee9 commit 3d13cc2

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
ruby-version:
9-
# - 2.0.0
9+
- 2.0.0
1010
- 2.7
1111
- 3.0.0
1212
- 3.4

lib/detect_language/client.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ def connection
5959
def setup_connection
6060
http = if config.proxy
6161
proxy = URI(config.proxy)
62-
proxy_use_ssl = proxy.scheme == 'https'
63-
Net::HTTP.new(base_uri.hostname, base_uri.port,
64-
proxy.hostname, proxy.port, proxy.user, proxy.password, nil, proxy_use_ssl)
62+
Net::HTTP.new(base_uri.hostname, base_uri.port, proxy.hostname, proxy.port, proxy.user, proxy.password)
6563
else
6664
Net::HTTP.new(base_uri.hostname, base_uri.port)
6765
end

spec/lib/detect_language_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
end
4848

4949
context 'with proxy' do
50-
let(:proxy) { 'https://dummy:pass@my-proxy:8080' }
50+
let(:proxy) { 'http://dummy:pass@my-proxy:8080' }
5151

5252
it 'uses the proxy for requests' do
5353
allow(Net::HTTP).to receive(:new)
54-
.with('ws.detectlanguage.com', 443, 'my-proxy', 8080, 'dummy', 'pass', nil, true)
54+
.with('ws.detectlanguage.com', 443, 'my-proxy', 8080, 'dummy', 'pass')
5555
.and_call_original
5656

5757
expect { subject }.to raise_error(SocketError)

0 commit comments

Comments
 (0)