File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -787,7 +787,7 @@ def make_bom_link(
787787 Returns:
788788 XsUri: Instance of XsUri with the generated BOM-Link URI.
789789 """
790- bom_ref_part = f'#{ bom_ref } ' if bom_ref else ''
790+ bom_ref_part = f'#{ str ( bom_ref ). replace ( "%" , "%25" ). replace ( "#" , "%23" ) } ' if bom_ref else ''
791791 uri = f'urn:cdx:{ serial_number } /{ version } { bom_ref_part } '
792792 return cls (uri )
793793
Original file line number Diff line number Diff line change @@ -554,7 +554,7 @@ def test_make_bom_link_without_bom_ref(self) -> None:
554554 def test_make_bom_link_with_bom_ref (self ) -> None :
555555 bom_link = XsUri .make_bom_link (UUID ('e5a93409-fd7c-4ffa-bf7f-6dc1630b1b9d' ),
556556 2 , BomRef ('componentA#sub-componentB%2' ))
557- self .assertEqual (bom_link .uri , 'urn:cdx:e5a93409-fd7c-4ffa-bf7f-6dc1630b1b9d/2#componentA#sub -componentB%2 ' )
557+ self .assertEqual (bom_link .uri , 'urn:cdx:e5a93409-fd7c-4ffa-bf7f-6dc1630b1b9d/2#componentA%23sub -componentB%252 ' )
558558
559559
560560class TestModelProperty (TestCase ):
You can’t perform that action at this time.
0 commit comments