mirror of
https://github.com/internetee/registry.git
synced 2025-06-13 16:14:47 +02:00
Accept puny-coded domain for polling Transfer Info
This commit is contained in:
parent
807561f3e5
commit
58d2bdb775
1 changed files with 8 additions and 3 deletions
|
@ -68,9 +68,7 @@ module Repp
|
||||||
|
|
||||||
def set_authorized_domain
|
def set_authorized_domain
|
||||||
@epp_errors ||= []
|
@epp_errors ||= []
|
||||||
h = {}
|
@domain = domain_from_url_hash
|
||||||
h[transfer_info_params[:id].match?(/\A[0-9]+\z/) ? :id : :name] = transfer_info_params[:id]
|
|
||||||
@domain = Domain.find_by!(h)
|
|
||||||
|
|
||||||
return if @domain.transfer_code.eql?(request.headers['Auth-Code'])
|
return if @domain.transfer_code.eql?(request.headers['Auth-Code'])
|
||||||
|
|
||||||
|
@ -78,6 +76,13 @@ module Repp
|
||||||
handle_errors
|
handle_errors
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def domain_from_url_hash
|
||||||
|
entry = transfer_info_params[:id]
|
||||||
|
return Domain.find(entry) if entry.match?(/\A[0-9]+\z/)
|
||||||
|
|
||||||
|
Domain.find_by!('name = ? OR name_puny = ?', entry, entry)
|
||||||
|
end
|
||||||
|
|
||||||
def limit
|
def limit
|
||||||
index_params[:limit] || 200
|
index_params[:limit] || 200
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue