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
1 changed files with 3 additions and 2 deletions

View File

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