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

17 lines
437 B
Elixir
Raw Normal View History

2020-05-16 06:16:33 -06: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-17 21:48:19 -06:00
method = Map.get(opts, :method, :purge)
headers = Map.get(opts, :headers, [])
options = Map.get(opts, :options, [])
2020-05-16 06:16:33 -06:00
Enum.each(urls, fn url ->
Pleroma.HTTP.request(method, url, "", headers, options)
end)
{:ok, "success"}
end
end