mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
request and response have the same domain schema
This commit is contained in:
parent
230fb301a7
commit
6f431232f4
7 changed files with 28 additions and 8 deletions
|
@ -4,6 +4,7 @@ module Epp
|
|||
before_action :find_domain, only: %i[info renew update transfer delete]
|
||||
before_action :find_password, only: %i[info update transfer delete]
|
||||
before_action :set_paper_trail_whodunnit
|
||||
before_action :parse_schemas_prefix_and_version
|
||||
|
||||
def info
|
||||
authorize! :info, @domain
|
||||
|
@ -243,5 +244,14 @@ module Epp
|
|||
end
|
||||
true
|
||||
end
|
||||
|
||||
def parse_schemas_prefix_and_version
|
||||
return unless params[:frame]
|
||||
|
||||
xml = params[:frame].gsub!(/(?<=>)(.*?)(?=<)/, &:strip).to_s
|
||||
res = xml.match(/xmlns:domain=\"https:\/\/epp.tld.ee\/schema\/(?<prefix>\w+-\w+)-(?<version>\w.\w).xsd/)
|
||||
@schema_version = res[:version]
|
||||
@schema_prefix = res[:prefix]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue