From f8ee63623e47eaea8eac85a77a37f7b838e01948 Mon Sep 17 00:00:00 2001 From: mattnowzari Date: Mon, 3 Mar 2025 11:14:31 -0500 Subject: [PATCH] handle_redirect no longer calls redirect_location() twice --- lib/crawler/http_executor.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/crawler/http_executor.rb b/lib/crawler/http_executor.rb index 00cd2e6..286e89c 100644 --- a/lib/crawler/http_executor.rb +++ b/lib/crawler/http_executor.rb @@ -178,11 +178,11 @@ def unsupported_content_type(crawl_task, response) #------------------------------------------------------------------------------------------------- def handle_redirect(crawl_task:, response:, result_args:) - # 304 responses are not guaranteed to have a location field - if response.redirect_location + redirect_location = response.redirect_location + if redirect_location return Crawler::Data::CrawlResult::Redirect.new( **result_args.merge( - location: response.redirect_location, + location: redirect_location, redirect_chain: crawl_task.redirect_chain ) )