fix: download file url escape

This commit is contained in:
yystopf 2021-12-20 15:39:33 +08:00
parent aa60de1dac
commit 6ffc2938a1
1 changed files with 1 additions and 1 deletions

View File

@ -238,7 +238,7 @@ class RepositoriesController < ApplicationController
def archive
domain = Gitea.gitea_config[:domain]
api_url = Gitea.gitea_config[:base_url]
archive_url = "/repos/#{@owner.login}/#{@repository.identifier}/archive/#{params[:archive]}"
archive_url = "/repos/#{@owner.login}/#{@repository.identifier}/archive/#{URI.escape(params[:archive])}"
file_path = [domain, api_url, archive_url].join
file_path = [file_path, "access_token=#{current_user&.gitea_token}"].join("?") if @repository.hidden?