fix: escape

This commit is contained in:
yystopf 2021-12-23 10:37:57 +08:00
parent 64423f1999
commit 78f464ccba
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ class RepositoriesController < ApplicationController
domain = Gitea.gitea_config[:domain]
api_url = Gitea.gitea_config[:base_url]
url = "/repos/#{@owner.login}/#{@repository.identifier}/raw/#{params[:filepath]}?ref=#{CGI.escapte(params[:ref])}"
url = "/repos/#{@owner.login}/#{@repository.identifier}/raw/#{URI.escape(params[:filepath])}?ref=#{CGI.escape(params[:ref])}"
file_path = [domain, api_url, url].join
file_path = [file_path, "access_token=#{current_user&.gitea_token}"].join("&")