Skip to content

Commit

Permalink
profiling(fix): use an unpadded base64 encoding (#1749)
Browse files Browse the repository at this point in the history
Recently we switched to a new crate for `base64` data encoding/decoding
(#1743).

In doing so, a regression that discards unpadded base64 profiles was
introduced.

This PR restores the expected behaviour. 

#skip-changelog
  • Loading branch information
viglia authored Jan 16, 2023
1 parent 37f965b commit 2a0976d
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions relay-profiling/src/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};

use android_trace_log::chrono::{DateTime, Utc};
use android_trace_log::{AndroidTraceLog, Clock, Time, Vm};
use data_encoding::BASE64;
use data_encoding::BASE64_NOPAD;
use serde::{Deserialize, Serialize};

use relay_general::protocol::EventId;
Expand Down Expand Up @@ -91,7 +91,7 @@ impl AndroidProfile {
}

fn parse(&mut self) -> Result<(), ProfileError> {
let profile_bytes = match BASE64.decode(self.sampled_profile.as_bytes()) {
let profile_bytes = match BASE64_NOPAD.decode(self.sampled_profile.as_bytes()) {
Ok(profile) => profile,
Err(_) => return Err(ProfileError::InvalidBase64Value),
};
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion relay-profiling/tests/fixtures/profiles/android/valid.json

Large diffs are not rendered by default.

0 comments on commit 2a0976d

Please sign in to comment.