commit: bb279c28025522764272468e3177a5f6701bc155
parent 5f6506d864239408e9fa3705c5dd7b241307241a
Author: Mark Felder <feld@feld.me>
Date: Tue, 27 Aug 2024 21:08:25 -0400
Pleroma.HTTP add AdapterHelper.can_stream? to assist with discovering if the current adapter supports returning a Stream body
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/pleroma/http/adapter_helper.ex b/lib/pleroma/http/adapter_helper.ex
@@ -118,4 +118,13 @@ defmodule Pleroma.HTTP.AdapterHelper do
host_charlist
end
end
+
+ #TODO add Finch support once we have an AdapterHelper for it
+ @spec can_stream? :: bool()
+ def can_stream? do
+ case Application.get_env(:tesla, :adapter) do
+ Tesla.Adapter.Gun -> true
+ _ -> false
+ end
+ end
end