From 0dc4ecbfb803f8a20b09e0a942e4e6991d56bc6f Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 16 Apr 2024 10:00:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93releases=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=93=BE=E6=8E=A5=E6=9E=84=E5=BB=BA,?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8E=E7=BC=80=E8=B7=AF=E7=94=B1=EF=BC=8C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/version_releases_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/version_releases_controller.rb b/app/controllers/version_releases_controller.rb index ffe51f38..cae97cbe 100644 --- a/app/controllers/version_releases_controller.rb +++ b/app/controllers/version_releases_controller.rb @@ -131,7 +131,9 @@ class VersionReleasesController < ApplicationController version = @repository.version_releases.find_by(tag_name: params["tag_name"]) attachment = version.attachments.find_by(filename: params["filename"]) tip_exception(404, '您访问的页面不存在或已被删除') if attachment.blank? - redirect_to "/api/attachments/#{attachment.uuid}" + send_file(absolute_path(local_path(attachment)), filename: attachment.title, stream: false, type: attachment.content_type.presence || 'application/octet-stream') + update_downloads(attachment) + # redirect_to "/api/attachments/#{attachment.uuid}" end