media_proxy: CSP, content-disposition
authorhref <href@random.sh>
Tue, 13 Nov 2018 14:58:02 +0000 (15:58 +0100)
committerhref <href@random.sh>
Tue, 13 Nov 2018 14:58:02 +0000 (15:58 +0100)
commit9b553a1087a3539280a4a085bcf7a79f29972f0a
treec22a5d599bb619ce640ac5b790d46eac2d95982d
parent22d20c497b813cdaedddb40a46df2f597311b235
media_proxy: CSP, content-disposition

* Adds CSP headers to the media proxy endpoint

* Sends `content-disposition: attachment; …` for non-image/video/audio
content types

The default list can be overwritten with `:media_proxy,
:safe_content_types` in the configuration.

* Also now appends the filename to the proxy URL (fixes some mobile apps,
it was requested a while ago)
lib/pleroma/web/media_proxy/controller.ex
lib/pleroma/web/media_proxy/media_proxy.ex
lib/pleroma/web/router.ex