mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: keep to old attachment route
This commit is contained in:
parent
0bd6d79459
commit
b44488b618
2 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue