Browse Source

Merge branch 'develop' into standalone_develop

tags/v4.0.0^2
yystopf 4 years ago
parent
commit
c2bd78d70d
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      app/controllers/repositories_controller.rb
  2. +2
    -0
      app/helpers/repositories_helper.rb

+ 1
- 1
app/controllers/repositories_controller.rb View File

@@ -254,7 +254,7 @@ class RepositoriesController < ApplicationController
url = "/repos/#{@owner.login}/#{@repository.identifier}/raw/#{params[:filepath]}?ref=#{params[:ref]}"
file_path = [domain, api_url, url].join
file_path = [file_path, "access_token=#{current_user&.gitea_token}"].join("&") if @repository.hidden?
file_path = [file_path, "access_token=#{current_user&.gitea_token}"].join("&")
redirect_to URI.escape(file_path)
end


+ 2
- 0
app/helpers/repositories_helper.rb View File

@@ -68,6 +68,8 @@ module RepositoriesHelper
# else
# new_r_content = r_content + "?raw=true"
# end
new_r_content = r_content
unless r_content.include?("http://") || r_content.include?("https://") || r_content.include?("mailto:")
# new_r_content = "#{path}" + new_r_content
new_r_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw?filepath=#{r_content}&ref=#{ref}"].join


Loading…
Cancel
Save