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