From 6059ed0d92702dbaf833f95f8a501fcd091ab31f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 28 Mar 2024 17:27:28 +0000 Subject: [PATCH] Drop redundant support for legacy trace files --- app/controllers/traces/icons_controller.rb | 7 +------ app/controllers/traces/pictures_controller.rb | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/controllers/traces/icons_controller.rb b/app/controllers/traces/icons_controller.rb index c86e391e4..a62e6af86 100644 --- a/app/controllers/traces/icons_controller.rb +++ b/app/controllers/traces/icons_controller.rb @@ -9,12 +9,7 @@ module Traces 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 diff --git a/app/controllers/traces/pictures_controller.rb b/app/controllers/traces/pictures_controller.rb index e19062167..0b26ed884 100644 --- a/app/controllers/traces/pictures_controller.rb +++ b/app/controllers/traces/pictures_controller.rb @@ -9,12 +9,7 @@ module Traces 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 -- 2.39.5