qb_akkoma/lib/pleroma/web/media_proxy/invalidations/http.ex
Maksim Pechnikov c33a4315fb updated docs
2020-05-18 06:48:19 +03:00

16 lines
437 B
Elixir

defmodule Pleroma.Web.MediaProxy.Invalidation.Http do
@behaviour Pleroma.Web.MediaProxy.Invalidation
@impl Pleroma.Web.MediaProxy.Invalidation
def purge(urls, opts) do
method = Map.get(opts, :method, :purge)
headers = Map.get(opts, :headers, [])
options = Map.get(opts, :options, [])
Enum.each(urls, fn url ->
Pleroma.HTTP.request(method, url, "", headers, options)
end)
{:ok, "success"}
end
end