Skip to content

Commit

Permalink
Remove leading slash from s3 key if present
Browse files Browse the repository at this point in the history
  • Loading branch information
iamvigneshwars committed Apr 19, 2024
1 parent 28c8b45 commit fe9919a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion processed_data/src/graphql/entities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,12 @@ impl AutoProcFileAttachment {
.to_string(),
);
key.push(<Option<String> as Clone>::clone(&self.file_name).unwrap());
key.to_string_lossy().to_string()
let key_str = key.to_string_lossy().to_string();
// Remove leading "/" if present
match key_str.strip_prefix('/') {
Some(stripped_key) => stripped_key.to_string(),
None => key_str,
}
}
}

Expand Down

0 comments on commit fe9919a

Please sign in to comment.