spc-pleroma/lib/pleroma/web/media_proxy/invalidations/http.ex

17 lines
452 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
method = Map.get(opts, :http_method, :purge)
headers = Map.get(opts, :http_headers, [])
options = Map.get(opts, :http_options, [])
Enum.each(urls, fn url ->
Pleroma.HTTP.request(method, url, "", headers, options)
end)
{:ok, "success"}
end
end