mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-17 18:38:50 +00:00
Update code for Crystal 0.36.0
Rename `HTTPClient@socket` to `HTTPClient@io`, see https://github.com/crystal-lang/crystal/pull/9543. Rename `URI#full_path` to `URI#request_target`, see https://github.com/crystal-lang/crystal/pull/10099.
This commit is contained in:
@@ -71,14 +71,14 @@ end
|
||||
class HTTPClient < HTTP::Client
|
||||
def set_proxy(proxy : HTTPProxy)
|
||||
begin
|
||||
@socket = proxy.open(host: @host, port: @port, tls: @tls, connection_options: proxy_connection_options)
|
||||
@io = proxy.open(host: @host, port: @port, tls: @tls, connection_options: proxy_connection_options)
|
||||
rescue IO::Error
|
||||
@socket = nil
|
||||
@io = nil
|
||||
end
|
||||
end
|
||||
|
||||
def unset_proxy
|
||||
@socket = nil
|
||||
@io = nil
|
||||
end
|
||||
|
||||
def proxy_connection_options
|
||||
|
||||
@@ -329,7 +329,7 @@ def get_referer(env, fallback = "/", unroll = true)
|
||||
end
|
||||
end
|
||||
|
||||
referer = referer.full_path
|
||||
referer = referer.request_target
|
||||
referer = "/" + referer.gsub(/[^\/?@&%=\-_.0-9a-zA-Z]/, "").lstrip("/\\")
|
||||
|
||||
if referer == env.request.path
|
||||
|
||||
Reference in New Issue
Block a user