From 17fefcf5921a805be974f27e646466e14b5fde4a Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 14 Feb 2018 02:13:55 +0200 Subject: [PATCH] Ensure EPP session id is passed --- app/controllers/epp_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb index 68ca93b23..91296aa42 100644 --- a/app/controllers/epp_controller.rb +++ b/app/controllers/epp_controller.rb @@ -4,6 +4,7 @@ class EppController < ApplicationController protect_from_forgery with: :null_session skip_before_action :verify_authenticity_token + before_action :ensure_session_id_passed before_action :generate_svtrid before_action :latin_only before_action :validate_against_schema @@ -377,7 +378,11 @@ class EppController < ApplicationController end def epp_session_id - cookies[:session] + cookies[:session] # Passed by mod_epp https://github.com/mod-epp/mod-epp#requestscript-interface + end + + def ensure_session_id_passed + raise 'EPP session id is empty' unless epp_session_id.present? end def update_epp_session