Skip to content

Commit

Permalink
Check if handle_upload returns a Transfer
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 committed Oct 1, 2024
1 parent a5d0a0e commit a94f8b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/dashboard/app/controllers/files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ 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
if @transfer.kind_of?(Transfer)
render 'transfers/show'
else
render json: {}
Expand Down

0 comments on commit a94f8b9

Please sign in to comment.