Merge branch 'proxy-redirect' into 'develop'
MediaProxyController: Use 301 for permanent redirects See merge request pleroma/pleroma!4313
This commit is contained in:
commit
4461cc984d
3 changed files with 38 additions and 6 deletions
|
|
@ -71,11 +71,15 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyController do
|
|||
drop_static_param_and_redirect(conn)
|
||||
|
||||
content_type == "image/gif" ->
|
||||
redirect(conn, external: media_proxy_url)
|
||||
conn
|
||||
|> put_status(301)
|
||||
|> redirect(external: media_proxy_url)
|
||||
|
||||
min_content_length_for_preview() > 0 and content_length > 0 and
|
||||
content_length < min_content_length_for_preview() ->
|
||||
redirect(conn, external: media_proxy_url)
|
||||
conn
|
||||
|> put_status(301)
|
||||
|> redirect(external: media_proxy_url)
|
||||
|
||||
true ->
|
||||
handle_preview(content_type, conn, media_proxy_url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue