Commit 4e88c93c authored by Mattias Päivärinta's avatar Mattias Päivärinta
Browse files

PDTT-419 - Allow upper case OK in domain status

parent 19e2eea4
...@@ -380,8 +380,13 @@ my %default_types; ...@@ -380,8 +380,13 @@ my %default_types;
} }
if ( $value =~ /^([^ ]+) {1,9}https:\/\/icann\.org\/epp#(.+)$/o ) { if ( $value =~ /^([^ ]+) {1,9}https:\/\/icann\.org\/epp#(.+)$/o ) {
if ( exists $DOMAIN_STATUS_CODES{$1} && $1 eq $2 ) { if ( exists $DOMAIN_STATUS_CODES{$1} ) {
return (); if ( $1 eq $2 ) {
return ();
}
elsif ( $1 eq 'ok' && $2 eq 'OK' ) {
return ();
}
} }
} }
......
...@@ -132,13 +132,16 @@ subtest 'token' => sub { ...@@ -132,13 +132,16 @@ subtest 'token' => sub {
}; };
subtest 'domain status' => sub { subtest 'domain status' => sub {
plan tests => 4; plan tests => 7;
reject_ok 'undef' => 'domain status'; reject_ok 'undef' => 'domain status';
reject_ok 'empty' => 'domain status', ''; reject_ok 'empty' => 'domain status', '';
accept_ok 'ok https://icann.org/epp#ok' => 'domain status', 'ok https://icann.org/epp#ok'; accept_ok 'ok https://icann.org/epp#ok' => 'domain status', 'ok https://icann.org/epp#ok';
reject_ok 'bad http://noticann.org/epp#bad' => 'domain status', 'bad http://noticann.org/epp#bad'; accept_ok 'explicit exception for upper case OK' => 'domain status', 'ok https://icann.org/epp#OK';
accept_ok 'inactive https://icann.org/epp#inactive' => 'domain status', 'inactive https://icann.org/epp#inactive';
reject_ok 'inactive https://icann.org/epp#INACTIVE' => 'domain status', 'inactive https://icann.org/epp#INACTIVE';
reject_ok 'bad http://noticann.org/epp#bad' => 'domain status', 'bad http://noticann.org/epp#bad';
}; };
subtest 'postal line' => sub { subtest 'postal line' => sub {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment