mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
FIX: keep to old attachment route
This commit is contained in:
@ -29,7 +29,7 @@ class UploadsController < ApplicationController
|
||||
return render_404 unless Discourse.store.internal?
|
||||
return render_404 if SiteSetting.prevent_anons_from_downloading_files && current_user.nil?
|
||||
|
||||
if upload = Upload.find_by(sha1: params[:sha])
|
||||
if upload = Upload.find_by(sha1: params[:sha]) || Upload.find_by(id: params[:id], url: request.fullpath)
|
||||
opts = { filename: upload.original_filename }
|
||||
opts[:disposition] = 'inline' if params[:inline]
|
||||
send_file(Discourse.store.path_for(upload), opts)
|
||||
|
Reference in New Issue
Block a user