forked from Gitlink/forgeplus
Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
commit
05f996034d
|
|
@ -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("&")
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue