Skip to content

Commit ef55a55

Browse files
committed
Fix an edge case with filename override AND platform suffix enabled at the same time producing non-compliant BOMs without .cdx extension. Previously: bom_x86_64-unknown-linux-gnu.xml, now: bom_x86_64-unknown-linux-gnu.cdx.xml
Signed-off-by: Sergey "Shnatsel" Davidoff <[email protected]>
1 parent 21bd6ff commit ef55a55

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cargo-cyclonedx/src/generator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,7 @@ impl GeneratedSbom {
816816
let platform_suffix = match output_options.platform_suffix {
817817
PlatformSuffix::NotIncluded => "".to_owned(),
818818
PlatformSuffix::Included => {
819+
extension = ".cdx"; // only a literal "bom.{xml,json}" is allowed not to have .cdx
819820
let target_string = self.sbom_config.target.as_ref().unwrap();
820821
format!("_{}", target_string.as_str())
821822
}

0 commit comments

Comments
 (0)