Add cast to fix sending File URLs.

This commit is contained in:
Danila Fedorin 2018-01-13 23:11:45 -08:00
parent cebc91d13a
commit 60835022fb

View File

@ -79,8 +79,9 @@ module Telepathy
when String when String
formdata.field("photo", photo.as(String)) formdata.field("photo", photo.as(String))
when File when File
formdata.file("photo", photo.as(IO), photo_file = photo.as(File)
HTTP::FormData::FileMetadata.new(filename: File.basename(photo.path))) formdata.file("photo", photo_file,
HTTP::FormData::FileMetadata.new(filename: File.basename(photo_file.path)))
end end
end end