Skip to content

Commit

Permalink
encode_body: Support %File.Stream{} from other nodes in `:form_mu…
Browse files Browse the repository at this point in the history
…ltipart`
  • Loading branch information
wojtekmach committed Aug 1, 2024
1 parent 507ebd1 commit 3f843dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/req/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@ defmodule Req.Utils do

stream = %File.Stream{} ->
filename = Path.basename(stream.path)
size = File.stat!(stream.path).size

size =
if stream.node == node() do
File.stat!(stream.path).size
else
:erpc.call(stream.node, File, :stat!, [stream.path]).size
end

options =
options
Expand Down

0 comments on commit 3f843dd

Please sign in to comment.