diff --git a/lib/src/utilities/http_redirect_check.dart b/lib/src/utilities/http_redirect_check.dart index c91ad77..7e8eafc 100644 --- a/lib/src/utilities/http_redirect_check.dart +++ b/lib/src/utilities/http_redirect_check.dart @@ -11,7 +11,7 @@ Future fetchWithRedirects( ...headers, 'User-Agent': userAgent ?? userAgentFallback, }; - var response = await http.get(Uri.parse(url), headers: allHeaders); + var response = await http.head(Uri.parse(url), headers: allHeaders); var redirectCount = 0; while (_isRedirect(response) && redirectCount < maxRedirects) { @@ -20,7 +20,7 @@ Future fetchWithRedirects( throw Exception('HTTP redirect without Location header'); } - response = await http.get(Uri.parse(location), headers: allHeaders); + response = await http.head(Uri.parse(location), headers: allHeaders); redirectCount++; } @@ -45,7 +45,7 @@ Future getYoutubeData( ...?headers, 'User-Agent': userAgent ?? userAgentFallback, }; - var response = await http.get( + var response = await http.head( Uri.parse( 'https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=$videoId&format=json', ),