akkoma/lib/pleroma/web/media_proxy/invalidations/http.ex

17 lines
437 B
Elixir
Raw Normal View History

2020-05-16 12:16:33 +00:00
defmodule Pleroma.Web.MediaProxy.Invalidation.Http do
@behaviour Pleroma.Web.MediaProxy.Invalidation
@impl Pleroma.Web.MediaProxy.Invalidation
def purge(urls, opts) do
2020-05-18 03:48:19 +00:00
method = Map.get(opts, :method, :purge)
headers = Map.get(opts, :headers, [])
options = Map.get(opts, :options, [])
2020-05-16 12:16:33 +00:00
Enum.each(urls, fn url ->
Pleroma.HTTP.request(method, url, "", headers, options)
end)
{:ok, "success"}
end
end