Skip to content

Commit

Permalink
Check for Faraday::UploadIO while rewinding
Browse files Browse the repository at this point in the history
Fixes #36
  • Loading branch information
iMacTia authored and olleolleolle committed Apr 12, 2024
1 parent f1929d9 commit ce15807
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/faraday/retry/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ def retry_request?(env, exception)
end

def rewind_files(body)
return unless defined?(UploadIO)
return unless defined?(Faraday::UploadIO)
return unless body.is_a?(Hash)

body.each do |_, value|
value.rewind if value.is_a?(UploadIO)
value.rewind if value.is_a?(Faraday::UploadIO)
end
end

Expand Down

0 comments on commit ce15807

Please sign in to comment.