更改:下载使用owner的gitea_token

This commit is contained in:
yystopf 2023-03-24 14:10:33 +08:00
parent a1cec48c81
commit d6888a03e3
1 changed files with 2 additions and 2 deletions

View File

@ -262,7 +262,7 @@ class RepositoriesController < ApplicationController
archive_url = "/repos/#{@owner.login}/#{@repository.identifier}/archive/#{Addressable::URI.escape(params[:archive])}"
file_path = [domain, api_url, archive_url].join
file_path = [file_path, "access_token=#{current_user&.gitea_token}"].join("?")
file_path = [file_path, "access_token=#{@owner&.gitea_token}"].join("?")
return render_not_found if !request.format.zip? && !request.format.gzip?
@ -275,7 +275,7 @@ class RepositoriesController < ApplicationController
url = "/repos/#{@owner.login}/#{@repository.identifier}/raw/#{Addressable::URI.escape(params[:filepath])}?ref=#{Addressable::URI.escape(params[:ref])}"
file_path = [domain, api_url, url].join
file_path = [file_path, "access_token=#{current_user&.gitea_token}"].join("&")
file_path = [file_path, "access_token=#{@owner&.gitea_token}"].join("&")
redirect_to file_path
end