Skip to content

Commit

Permalink
Check if handle_upload returns a Transfer (#3838)
Browse files Browse the repository at this point in the history
PosixTransfer will return the result of Pathname.chown (number of files
affected by operation) in directories with setgid bit set, which will
be considered a true value, but can not be used for render
"transfer/show".
  • Loading branch information
robinkar authored and johrstrom committed Oct 7, 2024
1 parent 1ddec66 commit 01ebbc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/dashboard/app/controllers/files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def upload
request.env[Rack::RACK_TEMPFILES].reject! { |f| f.path == params[:file].tempfile.path } unless posix_file?

@transfer = @path.handle_upload(params[:file].tempfile)
if @transfer
render "transfers/show"
if @transfer.kind_of?(Transfer)
render 'transfers/show'
else
render json: {}
end
Expand Down

0 comments on commit 01ebbc0

Please sign in to comment.