Fix MediaProxy Invalidation for Http method
This commit is contained in:
parent
72189d227f
commit
aa06fc584b
@ -405,6 +405,14 @@ config :pleroma, :media_proxy,
|
||||
],
|
||||
whitelist: []
|
||||
|
||||
config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http, %{
|
||||
"method" => :purge,
|
||||
"headers" => [],
|
||||
"options" => []
|
||||
}
|
||||
|
||||
config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script, script_path: nil
|
||||
|
||||
config :pleroma, :chat, enabled: true
|
||||
|
||||
config :phoenix, :format_encoders, json: Jason
|
||||
|
@ -283,10 +283,11 @@ This strategy allow perform custom http request to purge cache.
|
||||
|
||||
Example:
|
||||
```elixir
|
||||
config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http,
|
||||
method: :purge,
|
||||
headers: [],
|
||||
options: []
|
||||
config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Http, %{
|
||||
"method" => :purge,
|
||||
"headers" => [],
|
||||
"options" => []
|
||||
}
|
||||
```
|
||||
|
||||
## Link previews
|
||||
|
@ -17,7 +17,8 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.Http do
|
||||
Logger.debug("Running cache purge: #{inspect(urls)}")
|
||||
|
||||
Enum.each(urls, fn url ->
|
||||
with {:error, error} <- do_purge(method, url, headers, options) do
|
||||
with {:error, error} <-
|
||||
do_purge(method, url |> Pleroma.Web.MediaProxy.url(), headers, options) do
|
||||
Logger.error("Error while cache purge: url - #{url}, error: #{inspect(error)}")
|
||||
end
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user