Merge branch 'fix/cache-control-headers' into 'develop'

Fix Cache Control headers on media

See merge request pleroma/pleroma!2295
This commit is contained in:
rinpatch 2020-03-14 11:19:42 +00:00
commit d88c8a9614
4 changed files with 16 additions and 26 deletions

View file

@ -14,9 +14,14 @@ defmodule Pleroma.Plugs.UploadedMedia do
# no slashes
@path "media"
@default_cache_control_header "public, max-age=1209600"
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()