projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Undoing: Move undoing announcements to the pipeline everywhere.
[akkoma]
/
lib
/
pleroma
/
plugs
/
uploaded_media.ex
diff --git
a/lib/pleroma/plugs/uploaded_media.ex
b/lib/pleroma/plugs/uploaded_media.ex
index 74427709d8af65ddbc1df7757131f866e3188ccc..94147e0c42250c647984a3955dd98100208bc04f 100644
(file)
--- a/
lib/pleroma/plugs/uploaded_media.ex
+++ b/
lib/pleroma/plugs/uploaded_media.ex
@@
-18,7
+18,10
@@
defmodule Pleroma.Plugs.UploadedMedia do
def init(_opts) do
static_plug_opts =
def init(_opts) do
static_plug_opts =
- []
+ [
+ headers: %{"cache-control" => @default_cache_control_header},
+ cache_control_for_etags: @default_cache_control_header
+ ]
|> Keyword.put(:from, "__unconfigured_media_plug")
|> Keyword.put(:at, "/__unconfigured_media_plug")
|> Plug.Static.init()
|> Keyword.put(:from, "__unconfigured_media_plug")
|> Keyword.put(:at, "/__unconfigured_media_plug")
|> Plug.Static.init()
@@
-38,6
+41,7
@@
defmodule Pleroma.Plugs.UploadedMedia do
conn ->
conn
end
conn ->
conn
end
+ |> merge_resp_headers([{"content-security-policy", "sandbox"}])
config = Pleroma.Config.get(Pleroma.Upload)
config = Pleroma.Config.get(Pleroma.Upload)
@@
-60,10
+64,6
@@
defmodule Pleroma.Plugs.UploadedMedia do
Map.get(opts, :static_plug_opts)
|> Map.put(:at, [@path])
|> Map.put(:from, directory)
Map.get(opts, :static_plug_opts)
|> Map.put(:at, [@path])
|> Map.put(:from, directory)
- |> Map.put(:cache_control_for_etags, @default_cache_control_header)
- |> Map.put(:headers, %{
- "cache-control" => @default_cache_control_header
- })
conn = Plug.Static.call(conn, static_opts)
conn = Plug.Static.call(conn, static_opts)