lib/httpx/plugins/rate_limiter.rb in httpx-1.2.4 vs lib/httpx/plugins/rate_limiter.rb in httpx-1.2.6
- old
+ new
@@ -37,9 +37,11 @@
# When sent with any 3xx (Redirection) response, Retry-After indicates
# the minimum time that the user agent is asked to wait before issuing
# the redirected request.
#
def retry_after_rate_limit(_, response)
+ return unless response.is_a?(Response)
+
retry_after = response.headers["retry-after"]
return unless retry_after
Utils.parse_retry_after(retry_after)