Skip to content

Commit

Permalink
handle_redirect no longer calls redirect_location() twice
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnowzari committed Mar 3, 2025
1 parent 8e5daf8 commit f8ee636
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/crawler/http_executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
Expand Down

0 comments on commit f8ee636

Please sign in to comment.