Skip to content

Commit

Permalink
accept gzipped river data
Browse files Browse the repository at this point in the history
GH #460
  • Loading branch information
jberger committed Apr 30, 2016
1 parent ca63dab commit 05a163f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/MetaCPAN/Script/River.pm
Expand Up @@ -53,7 +53,14 @@ sub retrieve_river_summaries {

$self->handle_error( $resp->status_line ) unless $resp->is_success;

return decode_json $resp->content;
# cleanup headers if .json.gz is served as gzip type
# rather than json encoded with gzip
if ( $resp->header('Content-Type') eq 'application/x-gzip' ) {
$resp->header( 'Content-Type' => 'application/json' );
$resp->header( 'Content-Encoding' => 'gzip' );
}

return decode_json $resp->decoded_content;
}

__PACKAGE__->meta->make_immutable;
Expand Down

0 comments on commit 05a163f

Please sign in to comment.