Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove stdlib override for proxy initialization #5065

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions src/invidious/helpers/crystal_class_overrides.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,6 @@ end
class HTTP::Client
property family : Socket::Family = Socket::Family::UNSPEC

# Override stdlib to automatically initialize proxy if configured
#
# Accurate as of crystal 1.12.1

def initialize(@host : String, port = nil, tls : TLSContext = nil)
check_host_only(@host)

{% if flag?(:without_openssl) %}
if tls
raise "HTTP::Client TLS is disabled because `-D without_openssl` was passed at compile time"
end
@tls = nil
{% else %}
@tls = case tls
when true
OpenSSL::SSL::Context::Client.new
when OpenSSL::SSL::Context::Client
tls
when false, nil
nil
end
{% end %}

@port = (port || (@tls ? 443 : 80)).to_i

self.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy
end

def initialize(@io : IO, @host = "", @port = 80)
@reconnect = false

self.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy
end

private def io
io = @io
return io if io
Expand Down
Loading