Merge branch 'standalone_develop' into pre_trustie_server

This commit is contained in:
yystopf 2026-01-28 16:12:20 +08:00
commit dce9f3a35a
2 changed files with 2 additions and 2 deletions

View File

@ -309,7 +309,7 @@ class RepositoriesController < ApplicationController
api_url = GiteaService.gitea_config[:base_url]
tip_exception('不可访问') if params[:filepath].to_s.include?("chinese_dictionary.txt")
url = "/repos/#{@owner.login}/#{@repository.identifier}/raw/#{URI.escape(params[:filepath])}?ref=#{URI.escape(params[:ref])}"
url = "/repos/#{@owner.login}/#{@repository.identifier}/raw/#{CGI.escape(params[:filepath])}?ref=#{CGI.escape(params[:ref])}"
file_path = [domain, api_url, url].join
file_path = [file_path, "access_token=#{@owner&.gitea_token}"].join("&")

View File

@ -22,7 +22,7 @@ module ProjectsHelper
end
def render_download_file_url(owner, repository, filepath, ref)
[base_url, "/api/#{owner&.login}/#{repository.identifier}/raw/#{URI.escape(filepath)}?ref=#{URI.escape(ref)}"].join
[base_url, "/api/#{owner&.login}/#{repository.identifier}/raw/#{CGI.escape(filepath)}?ref=#{CGI.escape(ref)}"].join
end
def render_http_url(project)