Let OpenSSL::Query::ClaDB::has_cla massage the input identity
authorRichard Levitte <richard@levitte.org>
Thu, 15 Jun 2017 13:56:45 +0000 (15:56 +0200)
committerRichard Levitte <richard@levitte.org>
Thu, 15 Jun 2017 14:05:42 +0000 (16:05 +0200)
... exactly like OpenSSL::Query::ClaREST::has_cla does

lib/OpenSSL/Query/ClaREST.pm

index a92ef8cb68bb6a4fffd5be470d9fc20a2e632264..5cb4ae9c019d9f34f6bef1aeb142abe6ec729bc5 100644 (file)
@@ -38,6 +38,8 @@ sub _build__clahandler {
 sub has_cla {
   my $self = shift;
   my $id = shift;
+  if ($id =~ m|<(\S+\@\S+)>|) { $id = $1; }
+  croak "Malformed input ID" unless $id =~ m|^\S+(\@\S+)$|;
 
   my $ua = $self->_clahandler;
   my $json = $ua->get($self->base_url . '/0/HasCLA/'