Browse Source

no need to have content outside of the if

themage
theMage 4 years ago
parent
commit
8a968ab4b8
1 changed files with 16 additions and 0 deletions
  1. 16 0
      lib/HBase/JSONRest.pm

+ 16 - 0
lib/HBase/JSONRest.pm

@ -703,6 +703,22 @@ sub _extract_error_tiny {
703 703
    return $error_tiny;
704 704
}
705 705
706
sub _maybe_decompress {
707
    my $rs = shift;
708
   
709
    if (    exists $rs->{headers}
710
            && exists $rs->{ headers }->{ 'content-encoding' }
711
            && $rs->{ headers }->{ 'content-encoding' } eq 'gzip' ) {
712
        my $content = $rs->{content};
713
        my ( $content_decompressed, $scalar, $GunzipError );
714
        gunzip \$content => \$content_decompressed,
715
            MultiStream => 1, Append => 1, TrailingData => \$scalar
716
        or die "gunzip failed: $GunzipError\n";
717
    
718
        $rs->{content} = $content_decompressed;
719
    }
720
}
721
706 722
1;
707 723
708 724
__END__