diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-08-30 20:29:42 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-08-30 20:29:42 -0500 |
commit | 60c449e1d77c6e11ced796a7e088038d80137de6 (patch) | |
tree | 0da0448cf75ceec7d52c94f93ce236742e307727 /app/controllers | |
parent | 8a9c1b32dac14a8a39f4fb38db82d6487f84e294 (diff) |
make sure media attachments are not from a blocked account, CDN, or their subdomains
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/media_proxy_controller.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/controllers/media_proxy_controller.rb b/app/controllers/media_proxy_controller.rb index d820b257e..c46fc2124 100644 --- a/app/controllers/media_proxy_controller.rb +++ b/app/controllers/media_proxy_controller.rb @@ -7,7 +7,7 @@ class MediaProxyController < ApplicationController RedisLock.acquire(lock_options) do |lock| if lock.acquired? @media_attachment = MediaAttachment.remote.find(params[:id]) - redownload! if @media_attachment.needs_redownload? && !reject_media? + redownload! if !@media_attachment.blocked? && @media_attachment.needs_redownload? else raise Mastodon::RaceConditionError end @@ -35,8 +35,4 @@ class MediaProxyController < ApplicationController def lock_options { redis: Redis.current, key: "media_download:#{params[:id]}" } end - - def reject_media? - DomainBlock.find_by(domain: @media_attachment.account.domain)&.reject_media? - end end |