Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
support compression=gzip too
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Sep 15, 2023
1 parent 70c08a6 commit f43aea9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions capture/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub enum Compression {
#[default]
Unsupported,

#[serde(rename = "gzip-js")]
GzipJs,
#[serde(rename = "gzip", alias = "gzip-js")]
Gzip,
}

#[derive(Deserialize, Default)]
Expand Down Expand Up @@ -71,7 +71,7 @@ impl RawEvent {
tracing::debug!(len = bytes.len(), "decoding new event");

let payload = match query.compression {
Some(Compression::GzipJs) => {
Some(Compression::Gzip) => {
let mut d = GzDecoder::new(bytes.reader());
let mut s = String::new();
d.read_to_string(&mut s).map_err(|e| {
Expand Down Expand Up @@ -153,7 +153,7 @@ mod tests {
let bytes = Bytes::from(decoded_horrible_blob);
let events = RawEvent::from_bytes(
&EventQuery {
compression: Some(Compression::GzipJs),
compression: Some(Compression::Gzip),
lib_version: None,
sent_at: None,
},
Expand Down

0 comments on commit f43aea9

Please sign in to comment.