fix: download file need authorize

This commit is contained in:
2021-09-10 10:52:21 +08:00
parent d5de6aa66b
commit 90ace8b753
4 changed files with 18 additions and 1 deletions

View File

@@ -21,6 +21,10 @@ module ProjectsHelper
[base_url, archive_repositories_path(owner&.login, repository, "#{archive}.tar.gz")].join
end
def render_download_file_url(owner, repository, filepath, ref)
[base_url, "/api/#{owner&.login}/#{repository.identifier}/raw?filepath=#{filepath}&ref=#{ref}"].join
end
def render_http_url(project)
[gitea_domain, project.owner.login, "#{project.identifier}.git"].join('/')
end