diff --git a/app/controllers/concerns/epp/common.rb b/app/controllers/concerns/epp/common.rb index 952cdd4ca..2d9cd945b 100644 --- a/app/controllers/concerns/epp/common.rb +++ b/app/controllers/concerns/epp/common.rb @@ -120,12 +120,11 @@ module Epp::Common end def write_to_epp_log - request_object = OBJECT_TYPES[params_hash['epp']['xmlns:ns2']] if params[:frame] ApiLog::EppLog.create({ request: params[:raw_frame], request_command: params[:action], request_successful: epp_errors.empty?, - request_object: request_object, + request_object: params[:epp_object_type], # TODO: fix this for login and logout response: @response, api_user_name: @epp_user.try(:to_s) || current_epp_user.try(:to_s), api_user_registrar: @epp_user.try(:registrar).try(:to_s) || current_epp_user.try(:registrar).try(:to_s), diff --git a/config/application.rb b/config/application.rb index bb5c0c8fc..f60d2956b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -30,8 +30,6 @@ module Registry config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb') config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')] - config.autoload_paths << Rails.root.join('lib') - # Active Record used to suppresses errors raised within # `after_rollback`/`after_commit` callbacks and only printed them to the logs. # In the next version, these errors will no longer be suppressed. diff --git a/config/routes.rb b/config/routes.rb index 47cf3c287..79ac521be 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,9 +11,11 @@ class EppConstraint def matches?(request) element = "//#{@type}:#{request.params[:action]}" parsed_frame = Nokogiri::XML(request.params[:raw_frame]) - ret = parsed_frame.xpath("#{element}", OBJECT_TYPES[@type]).any? - request.params[:parsed_frame] = parsed_frame.remove_namespaces! if ret - ret + return false if parsed_frame.xpath("#{element}", OBJECT_TYPES[@type]).none? + + request.params[:parsed_frame] = parsed_frame.remove_namespaces! + request.params[:epp_object_type] = @type + true end end