From 24b5c4e672048727eef53b6f71672474ac18b38b Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 1 Dec 2023 14:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=BC=80=E5=8F=91=E5=88=86?= =?UTF-8?q?=E6=94=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 2bbccb495..e5362710c 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -39,7 +39,8 @@ class AttachmentsController < ApplicationController filepath, ref = url.split("/")[-1].split("?") url.gsub!(url.split("/")[-1], '') Rails.logger.info("url===#{url}") - request_url = [domain, api_url, URI.encode(url), CGI.escape(filepath), "?ref=#{CGI.escape(ref.split('ref=')[1])}&access_token=#{User.where(admin: true).take&.gitea_token}"].join + Rails.logger.info(filepath) + request_url = [domain, api_url, URI.encode(url), URI.escape(filepath), "?ref=#{URI.escape(ref.split('ref=')[1])}&access_token=#{User.where(admin: true).take&.gitea_token}"].join Rails.logger.info("request_url===#{request_url}") response = Faraday.get(request_url) filename = filepath