From 0d49725a2587fcbf4ed8daba244518d8756743bf Mon Sep 17 00:00:00 2001 From: mattnowzari Date: Fri, 21 Feb 2025 16:18:09 -0500 Subject: [PATCH] 304 response codes should not be treated as redirects, as they do not contain location fields in their headers --- lib/crawler/http_utils/response.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crawler/http_utils/response.rb b/lib/crawler/http_utils/response.rb index 5fb3cb0..b5d7808 100644 --- a/lib/crawler/http_utils/response.rb +++ b/lib/crawler/http_utils/response.rb @@ -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?