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 ) )