mirror of
https://github.com/internetee/registry.git
synced 2025-06-13 08:04:45 +02:00
Remove unused routes
This commit is contained in:
parent
958e370650
commit
9e5fdbcf11
5 changed files with 1 additions and 12 deletions
|
@ -6,10 +6,5 @@ module Epp
|
||||||
epp_errors << { code: params[:code], msg: params[:msg] }
|
epp_errors << { code: params[:code], msg: params[:msg] }
|
||||||
render_epp_response '/epp/error'
|
render_epp_response '/epp/error'
|
||||||
end
|
end
|
||||||
|
|
||||||
def not_found
|
|
||||||
epp_errors << { code: 2400, msg: t(:could_not_determine_object_type_check_xml_format_and_namespaces) }
|
|
||||||
render_epp_response '/epp/error'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -365,7 +365,6 @@ en:
|
||||||
request_method: 'Request method'
|
request_method: 'Request method'
|
||||||
response_code: 'Response code'
|
response_code: 'Response code'
|
||||||
request_params: 'Request params'
|
request_params: 'Request params'
|
||||||
could_not_determine_object_type_check_xml_format_and_namespaces: 'Could not determine object type. Check XML format and namespaces.'
|
|
||||||
unknown_expiry_relative_pattern: 'Expiry relative must be compatible to ISO 8601'
|
unknown_expiry_relative_pattern: 'Expiry relative must be compatible to ISO 8601'
|
||||||
unknown_expiry_absolute_pattern: 'Expiry absolute must be compatible to ISO 8601'
|
unknown_expiry_absolute_pattern: 'Expiry absolute must be compatible to ISO 8601'
|
||||||
mutally_exclusive_params: 'Mutually exclusive parameters: %{params}'
|
mutally_exclusive_params: 'Mutually exclusive parameters: %{params}'
|
||||||
|
|
|
@ -3,17 +3,13 @@ require_dependency 'epp_constraint'
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
namespace(:epp, defaults: { format: :xml }) do
|
namespace(:epp, defaults: { format: :xml }) do
|
||||||
match 'session/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
|
match 'session/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
|
||||||
match 'session/pki/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
|
|
||||||
|
|
||||||
post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain)
|
post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain)
|
||||||
post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact)
|
post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact)
|
||||||
post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll)
|
post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll)
|
||||||
post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay)
|
post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay)
|
||||||
|
|
||||||
post 'command/:command', to: 'errors#not_found', constraints: EppConstraint.new(:not_found) # fallback route
|
|
||||||
|
|
||||||
get 'error/:command', to: 'errors#error'
|
get 'error/:command', to: 'errors#error'
|
||||||
match "*command", to: 'errors#error', via: [:post, :get, :patch, :put, :delete]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
mount Repp::API => '/'
|
mount Repp::API => '/'
|
||||||
|
|
|
@ -123,7 +123,6 @@
|
||||||
<text text-anchor="middle" x="808" y="-13.8" font-family="Times,serif" font-size="14.00">Epp::ErrorsController</text>
|
<text text-anchor="middle" x="808" y="-13.8" font-family="Times,serif" font-size="14.00">Epp::ErrorsController</text>
|
||||||
<polyline fill="none" stroke="black" points="740.5,-6 875.5,-6 "/>
|
<polyline fill="none" stroke="black" points="740.5,-6 875.5,-6 "/>
|
||||||
<text text-anchor="start" x="748.5" y="9.2" font-family="Times,serif" font-size="14.00">error</text>
|
<text text-anchor="start" x="748.5" y="9.2" font-family="Times,serif" font-size="14.00">error</text>
|
||||||
<text text-anchor="start" x="748.5" y="24.2" font-family="Times,serif" font-size="14.00">not_found</text>
|
|
||||||
<polyline fill="none" stroke="black" points="740.5,32 875.5,32 "/>
|
<polyline fill="none" stroke="black" points="740.5,32 875.5,32 "/>
|
||||||
<polyline fill="none" stroke="black" points="740.5,56 875.5,56 "/>
|
<polyline fill="none" stroke="black" points="740.5,56 875.5,56 "/>
|
||||||
<text text-anchor="start" x="748.5" y="71.2" font-family="Times,serif" font-size="14.00">_layout</text>
|
<text text-anchor="start" x="748.5" y="71.2" font-family="Times,serif" font-size="14.00">_layout</text>
|
||||||
|
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
@ -15,7 +15,7 @@ class EppConstraint
|
||||||
request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame] || request.params[: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!
|
request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
|
||||||
|
|
||||||
unless [:keyrelay, :poll, :session, :not_found].include?(@type)
|
unless [:keyrelay, :poll, :session].include?(@type)
|
||||||
element = "//#{@type}:#{request.params[:action]}"
|
element = "//#{@type}:#{request.params[:action]}"
|
||||||
return false if request.params[:nokogiri_frame].xpath("#{element}", OBJECT_TYPES[@type]).none?
|
return false if request.params[:nokogiri_frame].xpath("#{element}", OBJECT_TYPES[@type]).none?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue