mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 23:54:44 +02:00
added response for wrong epp path
This commit is contained in:
parent
5b8b18f584
commit
4cf7a103c8
9 changed files with 91 additions and 28 deletions
|
@ -11,6 +11,8 @@ class EppConstraint
|
|||
# creates parsed_frame, detects epp request object
|
||||
def matches?(request)
|
||||
# TODO: Maybe move this to controller to keep params clean
|
||||
return redirect_to_error_controller(request) if request.params[:action] == 'wrong_schema'
|
||||
|
||||
request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip} if request.params[:raw_frame]
|
||||
request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame] || request.params[:frame])
|
||||
request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
|
||||
|
@ -23,4 +25,9 @@ class EppConstraint
|
|||
request.params[:epp_object_type] = @type
|
||||
true
|
||||
end
|
||||
|
||||
def redirect_to_error_controller(request)
|
||||
request.params[:epp_object_type] = @error
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue