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,9 +380,14 @@ my %default_types;
}
if ( $value =~ /^([^ ]+) {1,9}https:\/\/icann\.org\/epp#(.+)$/o ) {
if ( exists $DOMAIN_STATUS_CODES{$1} && $1 eq $2 ) {
if ( exists $DOMAIN_STATUS_CODES{$1} ) {
if ( $1 eq $2 ) {
return ();
}
elsif ( $1 eq 'ok' && $2 eq 'OK' ) {
return ();
}
}
}
return ( 'expected domain status' );
......
......@@ -132,12 +132,15 @@ subtest 'token' => sub {
};
subtest 'domain status' => sub {
plan tests => 4;
plan tests => 7;
reject_ok 'undef' => '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 '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';
};
......
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