Browse Source

更改:下载使用owner的gitea_token

pull/343/head
yystopf 3 years ago
parent
commit
d6888a03e3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/controllers/repositories_controller.rb

+ 2
- 2
app/controllers/repositories_controller.rb 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


Loading…
Cancel
Save