40c624efcbee51c56f38b8db54ba490f81797980
[akkoma] / lib / pleroma / web / media_proxy / invalidations / http.ex
1 defmodule Pleroma.Web.MediaProxy.Invalidation.Http do
2 @behaviour Pleroma.Web.MediaProxy.Invalidation
3
4 @impl Pleroma.Web.MediaProxy.Invalidation
5 def purge(urls, opts) do
6 method = Map.get(opts, :http_method, :purge)
7 headers = Map.get(opts, :http_headers, [])
8 options = Map.get(opts, :http_options, [])
9
10 Enum.each(urls, fn url ->
11 Pleroma.HTTP.request(method, url, "", headers, options)
12 end)
13
14 {:ok, "success"}
15 end
16 end