[Rt-commit] rtir branch, 5.0/fix-net-whois-test-functionality, repushed

Aaron Trevena ast at bestpractical.com
Tue Jun 23 06:38:15 EDT 2020


The branch 5.0/fix-net-whois-test-functionality was deleted and repushed:
       was 828575c71c121c8f5b11fb41ede2c10fbf674a8b
       now 054c86861a28c84ba9d8acfcefd74b30688182bb

1: 828575c7 ! 1: 054c8686 Updated whois lookups to hand-parse responses following Net::WHOIS::RIPE
    @@ -1,15 +1,13 @@
     Author: Aaron Trevena <ast at bestpractical.com>
     
    -    Fix whois lookup by ip address with new Net::WHOIS::RIPE
    +    Updated whois lookups to hand-parse responses following Net::WHOIS::RIPE
         
    -    Remove/Replace Net::Whois::Object calling code.
    +    Prior to upgrading to Net::Whois::RIPE 2.x we could iterate through attributes for the result of queries.
    +    The updated API replacing the attributes method call with Net::Whois::Object throws fatal errors on verisign
    +    responses for ip and dns lookups (https://github.com/arhuman/Net-Whois-RIPE/issues/27) so we parse response here.
         
    -    Net::Whois::Object can't parse most responses from whois servers and will throw
    -    fatal errors for normal responses, it's simpler and more reliable to just parse
    -    ourselves.
    -    
    -    Removed code using Net::Whois::Object that was very rarely called as the hand-parse
    -    check was pretty much always returning true.
    +    Also removed code using Net::Whois::Object in Tools/Lookup.html that was almost never called as the
    +    handparse flag was defaulted to true, and was never provided as false. check was pretty much always returning true.
     
     diff --git a/html/RTIR/Tools/Elements/GetEmailFromIP b/html/RTIR/Tools/Elements/GetEmailFromIP
     --- a/html/RTIR/Tools/Elements/GetEmailFromIP
    @@ -23,6 +21,11 @@
     -foreach my $obj (@objects) {
     -    foreach my $attr ( grep lc $_ eq lc $field, $obj->attributes ) {
     -        push @res, $obj->$attr();
    ++# Prior to upgrading to Net::Whois::RIPE 2.x we could iterate through attributes for the result
    ++# of this query. The updated API replacing the attributes method call with Net::Whois::Object throws
    ++# fatal errors on verisign responses for ip lookups, so we parse response here.
    ++# (https://github.com/arhuman/Net-Whois-RIPE/issues/27)
    ++
     +my @res = ( );
     +while ( ! $iterator->is_exhausted() ) {
     +    foreach my $line ( split /\n/, $iterator->value() ) {
    @@ -46,6 +49,17 @@
     --- a/html/RTIR/Tools/Elements/ToolResultsWhois
     +++ b/html/RTIR/Tools/Elements/ToolResultsWhois
     @@
    + <b><% $WhoisError %></b>
    + % }
    + <%PERL>
    ++
    ++# Prior to upgrading to Net::Whois::RIPE 2.x we could iterate through attributes for the result
    ++# of this query. The updated API replacing the attributes method call with Net::Whois::Object throws
    ++# fatal errors on verisign & other responses for lookups, so we parse response here.
    ++# (https://github.com/arhuman/Net-Whois-RIPE/issues/27)
    ++
    + my $DoInvestigate = 0;
    + if ($WhoisIterator) {
          while ( $WhoisIterator->isnt_exhausted) {
              my $block = $WhoisIterator->value;
              $SavedContent .= $block . "\n";
    @@ -102,3 +116,23 @@
      %# Don't offer the option of Investigating to unless there are addresses
      % if ( $DoInvestigate ) {
      <& /Elements/Submit,
    +@@
    + 
    + <%args>
    + $q =>  undef
    +-$handparse => 1
    + $TicketObj => undef
    + $WhoisServer => undef
    + $server => undef
    +
    +diff --git a/t/tools/lookup.t b/t/tools/lookup.t
    +--- a/t/tools/lookup.t
    ++++ b/t/tools/lookup.t
    +@@
    + diag "Test Lookup page directly";
    + {
    +     $agent->get_ok("/RTIR/Tools/Lookup.html", "Loaded Lookup page");
    +-
    + SKIP:{
    +     skip "No network", 3 if $no_network;
    +     $agent->form_name('ToolFormWhois');



More information about the rt-commit mailing list