Replace use of deprecated Faraday::UploadIO (#13127)

Faraday 0.16.0 added Faraday::FilePart as an alias to Faraday::UploadIO
and deprecated Faraday::UploadIO. In Faraday 2.0 the deprecated UploadIO
was removed.

Fixes: e12100b033
This commit is contained in:
Ewoud Kohl van Wijngaarden
2022-08-11 09:18:39 +02:00
committed by GitHub
parent c987e75f92
commit 9abaa53db1
2 changed files with 2 additions and 2 deletions

View File

@@ -90,7 +90,7 @@
case value
when ::File, ::Tempfile
# TODO hardcode to application/octet-stream, need better way to detect content type
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
when ::Array, nil
# let Faraday handle Array and nil parameters
data[key] = value

View File

@@ -135,7 +135,7 @@ module Petstore
case value
when ::File, ::Tempfile
# TODO hardcode to application/octet-stream, need better way to detect content type
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
when ::Array, nil
# let Faraday handle Array and nil parameters
data[key] = value