mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Refactor #2752
This commit is contained in:
parent
c79fee5a49
commit
2148cc57e5
16 changed files with 935 additions and 24 deletions
|
@ -9,13 +9,9 @@ class EppController < ApplicationController
|
|||
before_action :validate_against_schema
|
||||
|
||||
def validate_against_schema
|
||||
# filename =
|
||||
# if params[:epp_object_type] == :domain
|
||||
|
||||
return if params[:action] == 'hello'
|
||||
params[:schema] = 'epp-1.0.xsd' unless params[:schema]
|
||||
|
||||
xsd = Nokogiri::XML::Schema(File.read("doc/schemas/#{params[:schema]}"))
|
||||
xsd = Nokogiri::XML::Schema(File.read("lib/schemas/#{params[:schema]}"))
|
||||
xsd.validate(Nokogiri::XML(params[:raw_frame])).each do |error|
|
||||
epp_errors << {
|
||||
code: 2001,
|
||||
|
@ -23,7 +19,6 @@ class EppController < ApplicationController
|
|||
}
|
||||
end
|
||||
|
||||
# end
|
||||
handle_errors and return if epp_errors.any?
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue