Skip to content

Commit

Permalink
Drop redundant support for legacy trace files
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Mar 28, 2024
1 parent 91143a5 commit 6059ed0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions app/controllers/traces/icons_controller.rb
Expand Up @@ -9,12 +9,7 @@ def show
trace = Trace.visible.imported.find(params[:trace_id])

if trace.public? || (current_user && current_user == trace.user)
if trace.icon.attached?
redirect_to rails_blob_path(trace.icon, :disposition => "inline")
else
expires_in 7.days, :private => !trace.public?, :public => trace.public?
send_file(trace.icon_picture_name, :filename => "#{trace.id}_icon.gif", :type => "image/gif", :disposition => "inline")
end
redirect_to rails_blob_path(trace.icon, :disposition => "inline")
else
head :forbidden
end
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/traces/pictures_controller.rb
Expand Up @@ -9,12 +9,7 @@ def show
trace = Trace.visible.imported.find(params[:trace_id])

if trace.public? || (current_user && current_user == trace.user)
if trace.icon.attached?
redirect_to rails_blob_path(trace.image, :disposition => "inline")
else
expires_in 7.days, :private => !trace.public?, :public => trace.public?
send_file(trace.large_picture_name, :filename => "#{trace.id}.gif", :type => "image/gif", :disposition => "inline")
end
redirect_to rails_blob_path(trace.image, :disposition => "inline")
else
head :forbidden
end
Expand Down

0 comments on commit 6059ed0

Please sign in to comment.