fix the build
This commit is contained in:
parent
b44488b618
commit
7d3b7a5657
|
@ -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]) || Upload.find_by(id: params[:id], url: request.fullpath)
|
||||
if upload = Upload.find_by(sha1: params[:sha]) || Upload.find_by(id: params[:id], url: request.env["PATH_INFO"])
|
||||
opts = { filename: upload.original_filename }
|
||||
opts[:disposition] = 'inline' if params[:inline]
|
||||
send_file(Discourse.store.path_for(upload), opts)
|
||||
|
|
|
@ -133,7 +133,7 @@ describe UploadsController do
|
|||
end
|
||||
|
||||
it "returns 404 when the upload doens't exist" do
|
||||
Upload.expects(:find_by).with(sha1: sha).returns(nil)
|
||||
Upload.stubs(:find_by).returns(nil)
|
||||
|
||||
get :show, site: site, sha: sha, extension: "pdf"
|
||||
expect(response.response_code).to eq(404)
|
||||
|
|
Loading…
Reference in New Issue