From 142d974641dc8483a63c978c2745f47b82041fc7 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 7 Nov 2019 12:25:34 -0500 Subject: [PATCH] Use force_resolve for search suggestions --- src/invidious/helpers/utils.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index d9ada146..a4b7443e 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -1618,7 +1618,7 @@ struct HTTPPool response rescue ex conn = HTTPClient.new(url) - conn.family = (url.host == "www.youtube.com") ? CONFIG.force_resolve : Socket::Family::UNSPEC + conn.family = (url.host == "www.youtube.com" || url.host == "suggestqueries.google.com") ? CONFIG.force_resolve : Socket::Family::UNSPEC conn.read_timeout = 10.seconds conn.connect_timeout = 10.seconds yield conn @@ -1630,7 +1630,7 @@ struct HTTPPool private def build_pool ConnectionPool(HTTPClient).new(capacity: capacity, timeout: timeout) do client = HTTPClient.new(url) - client.family = (url.host == "www.youtube.com") ? CONFIG.force_resolve : Socket::Family::UNSPEC + client.family = (url.host == "www.youtube.com" || url.host == "suggestqueries.google.com") ? CONFIG.force_resolve : Socket::Family::UNSPEC client.read_timeout = 10.seconds client.connect_timeout = 10.seconds client