raw api limit request.path
This commit is contained in:
parent
5a1e942d1c
commit
150f7a485b
|
@ -14,7 +14,7 @@ class RepositoriesController < ApplicationController
|
||||||
before_action :get_latest_commit, only: %i[entries sub_entries top_counts]
|
before_action :get_latest_commit, only: %i[entries sub_entries top_counts]
|
||||||
before_action :get_statistics, only: %i[top_counts]
|
before_action :get_statistics, only: %i[top_counts]
|
||||||
before_action :require_referer, only: [:raw]
|
before_action :require_referer, only: [:raw]
|
||||||
before_action :request_limit, only: [:raw]
|
# before_action :request_limit, only: [:raw]
|
||||||
before_action :request_raw_limit, only: [:raw]
|
before_action :request_raw_limit, only: [:raw]
|
||||||
|
|
||||||
def files
|
def files
|
||||||
|
@ -301,8 +301,6 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def raw
|
def raw
|
||||||
Rails.logger.info("request.host===#{request.host},request.referer===#{request.referer}")
|
|
||||||
tip_exception(403, "你没有权限访问") if request.host.present? && !request.referer.to_s.include?(request.host.to_s.gsub("www.",""))
|
|
||||||
domain = GiteaService.gitea_config[:domain]
|
domain = GiteaService.gitea_config[:domain]
|
||||||
api_url = GiteaService.gitea_config[:base_url]
|
api_url = GiteaService.gitea_config[:base_url]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue