Skip to content

Commit

Permalink
304 response codes should not be treated as redirects, as they do not…
Browse files Browse the repository at this point in the history
… contain location fields in their headers
  • Loading branch information
mattnowzari committed Feb 21, 2025
1 parent c3e9076 commit 0d49725
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/crawler/http_utils/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def time_since_request_start
end

def redirect?
code >= 300 && code <= 399
# We should ignore code 304s as they do not contain a location field in the header
code >= 300 && code <= 399 && code != 304
end

def error?
Expand Down

0 comments on commit 0d49725

Please sign in to comment.