Skip to content

Commit

Permalink
Fix issue with only first member of a multi-member gz file being ungz…
Browse files Browse the repository at this point in the history
…ipped (#27)

* Fix issue with only first member of a multi-member gz file being ungzipped

* change version
  • Loading branch information
RafalSumislawski authored Jan 16, 2024
1 parent 7bc20c0 commit 823fdc6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog

## v0.0.8 Beta / 2024-01-16
### 🧰 Bug fixes 🧰
- Fix issue with decompression of some gzip files

## v0.0.7 Beta / 2024-01-08
### 🚀 New components 🚀
- Added support for kinesis Text and Cloudwatch Logs
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "coralogix-aws-shipper"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use aws_lambda_events::encodings::Base64Data;
use aws_sdk_s3::Client;
use cx_sdk_rest_logs::DynLogExporter;
use fancy_regex::Regex;
use flate2::read::GzDecoder;
use flate2::read::MultiGzDecoder;
use itertools::Itertools;
use lambda_runtime::Error;
use std::ffi::OsStr;
Expand Down Expand Up @@ -473,7 +473,7 @@ fn ungzip(compressed_data: Vec<u8>, key: String) -> Result<Vec<u8>, Error> {
tracing::warn!("Input data is empty, cannot ungzip a zero-byte file.");
return Ok(Vec::new());
}
let mut d = GzDecoder::new(&compressed_data[..]);
let mut d = MultiGzDecoder::new(&compressed_data[..]);
let mut v = Vec::new();
match d.read_to_end(&mut v) {
Ok(_) => Ok(v),
Expand Down
2 changes: 1 addition & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Metadata:
- sqs
- kinesis
HomePageUrl: https://coralogix.com
SemanticVersion: 0.0.7
SemanticVersion: 0.0.8
SourceCodeUrl: https://github.com/coralogix/coralogix-aws-shipper

AWS::CloudFormation::Interface:
Expand Down

0 comments on commit 823fdc6

Please sign in to comment.