mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Move xml parsing to epp constraint #2752
This commit is contained in:
parent
2148cc57e5
commit
c94da28af6
2 changed files with 5 additions and 5 deletions
|
@ -9,10 +9,10 @@ class EppController < ApplicationController
|
|||
before_action :validate_against_schema
|
||||
|
||||
def validate_against_schema
|
||||
return if params[:action] == 'hello'
|
||||
return if ['hello', 'error'].include?(params[:action])
|
||||
params[:schema] = 'epp-1.0.xsd' unless params[:schema]
|
||||
xsd = Nokogiri::XML::Schema(File.read("lib/schemas/#{params[:schema]}"))
|
||||
xsd.validate(Nokogiri::XML(params[:raw_frame])).each do |error|
|
||||
xsd.validate(params[:nokogiri_frame]).each do |error|
|
||||
epp_errors << {
|
||||
code: 2001,
|
||||
msg: error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue