mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-26 23:43:36 +00:00
Use HTTP::Client directly in instance list job
The HTTP::Client created via `make_client` is affected by the force_resolve configuration option. However, api.invidious.io does not support ipv6 and as such any request with ipv6 to api.invidious.io will instead raise. Directly calling the HTTP::Client will ignore the force_resolve option allowing requests to go through ipv4 when needed.
This commit is contained in:
parent
cff25a7b25
commit
41c978d350
@ -58,7 +58,10 @@ class Invidious::Jobs::InstanceListRefreshJob < Invidious::Jobs::BaseJob
|
|||||||
# Fetches information regarding instances from api.invidious.io or an otherwise configured URL
|
# Fetches information regarding instances from api.invidious.io or an otherwise configured URL
|
||||||
private def fetch_instances : Array(JSON::Any)
|
private def fetch_instances : Array(JSON::Any)
|
||||||
begin
|
begin
|
||||||
instance_api_client = make_client(URI.parse("https://api.invidious.io"))
|
# We directly call the stdlib HTTP::Client here as it allows us to negate the effects
|
||||||
|
# of the force_resolve config option. This is needed as api.invidious.io does not support ipv6
|
||||||
|
# and as such the following request raises if we were to use force_resolve with the ipv6 value.
|
||||||
|
instance_api_client = HTTP::Client.new(URI.parse("https://api.invidious.io"))
|
||||||
|
|
||||||
# Timeouts
|
# Timeouts
|
||||||
instance_api_client.connect_timeout = 10.seconds
|
instance_api_client.connect_timeout = 10.seconds
|
||||||
|
Loading…
Reference in New Issue
Block a user