Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
otherguy committed Apr 23, 2024
1 parent cf9022b commit 48e0332
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/remove_bg/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ def self.determine_content_type(file_path)

private_class_method :determine_content_type

# Use File for Faraday 2+ and Faraday::FilePart below that
FARADAY_FILE = defined?(Faraday::FilePart) ? Faraday::FilePart : File
# UploadIO for Faraday <= 0.16.0, Faraday::FilePart for 1.x and File for 2.x
FARADAY_FILE = Faraday::UploadIO if defined?(Faraday::UploadIO)
FARADAY_FILE = Faraday::FilePart if defined?(Faraday::FilePart)
FARADAY_FILE = File unless defined?(FARADAY_FILE)

private_constant :FARADAY_FILE
end
end

0 comments on commit 48e0332

Please sign in to comment.