Pleroma.HTTP add AdapterHelper.can_stream? to assist with discovering if the current adapter supports returning a Stream body

This commit is contained in:
Mark Felder 2024-08-27 21:08:25 -04:00
parent 5f6506d864
commit bb279c2802

View file

@ -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