mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
Refactor latin errors #2716
This commit is contained in:
parent
2a1e8a325d
commit
968f5d180d
2 changed files with 12 additions and 2 deletions
|
@ -125,8 +125,13 @@ class EppController < ApplicationController
|
||||||
def latin_only
|
def latin_only
|
||||||
return true if params['frame'].blank?
|
return true if params['frame'].blank?
|
||||||
return true if params['frame'].match(/\A[\p{Latin}\p{Z}\p{P}\p{S}\p{Cc}\p{Cf}\w_\'\+\-\.\(\)\/]*\Z/i)
|
return true if params['frame'].match(/\A[\p{Latin}\p{Z}\p{P}\p{S}\p{Cc}\p{Cf}\w_\'\+\-\.\(\)\/]*\Z/i)
|
||||||
render_epp_response '/epp/latin_error'
|
|
||||||
false
|
epp_errors << {
|
||||||
|
msg: 'Parameter value policy error. Allowed only Latin characters.',
|
||||||
|
code: '2306'
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_errors and return false
|
||||||
end
|
end
|
||||||
|
|
||||||
# VALIDATION
|
# VALIDATION
|
||||||
|
|
|
@ -71,6 +71,11 @@ describe 'EPP Session', epp: true do
|
||||||
response[:msg].should == 'Parameter value policy error. Allowed only Latin characters.'
|
response[:msg].should == 'Parameter value policy error. Allowed only Latin characters.'
|
||||||
response[:result_code].should == '2306'
|
response[:result_code].should == '2306'
|
||||||
response[:clTRID].should == 'ABC-12345'
|
response[:clTRID].should == 'ABC-12345'
|
||||||
|
|
||||||
|
log = ApiLog::EppLog.last
|
||||||
|
log.request_command.should == 'login'
|
||||||
|
log.request_successful.should == false
|
||||||
|
log.api_user_name.should == 'api-public'
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with valid user' do
|
context 'with valid user' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue