Skip to content

Commit 37ed548

Browse files
committed
Fix supporting Elixir v1.13
1 parent 35aec22 commit 37ed548

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/req/utils.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,12 @@ defmodule Req.Utils do
376376
stream = %File.Stream{} ->
377377
filename = Path.basename(stream.path)
378378

379+
# TODO: Simplify when we require Elixir v1.15
379380
size =
380-
if stream.node == node() do
381+
if not Map.has_key?(stream, :node) or stream.node == node() do
381382
File.stat!(stream.path).size
382383
else
383-
:erpc.call(stream.node, File, :stat!, [stream.path]).size
384+
:erpc.call(stream.node, fn -> File.stat!(stream.path).size end)
384385
end
385386

386387
options =

0 commit comments

Comments
 (0)