Skip to content

Commit

Permalink
fix(report): removes git::http from uri in sarif (#5244)
Browse files Browse the repository at this point in the history
* fix(sarif): removes git::http from uri in sarif
* fix(sarif): removes git::http from uri in sarif

## Description

## Related issues
- Fixes #5003

## Checklist
- [ ] I've read the [guidelines for contributing](https://aquasecurity.github.io/trivy/latest/community/contribute/pr/) to this repository.
- [ ] I've followed the [conventions](https://aquasecurity.github.io/trivy/latest/community/contribute/pr/#title) in the PR title.
- [ ] I've added tests that prove my fix is effective or that my feature works.
- [ ] I've updated the [documentation](https://github.com/aquasecurity/trivy/blob/main/docs) with the relevant information (if needed).
- [ ] I've added usage information (if the PR introduces new options)
- [ ] I've included a "before" and "after" example to the description (if the PR is a user interface change).

* fix lint

---------

Co-authored-by: Simar <simar@linux.com>
  • Loading branch information
megalucio and simar7 committed Oct 2, 2023
1 parent 4f1d576 commit 23b5fec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/report/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func ToPathUri(input string, resultClass types.ResultClass) string {
input = ref.Context().RepositoryStr()
}

return strings.ReplaceAll(input, "\\", "/")
return strings.ReplaceAll(strings.ReplaceAll(input, "\\", "/"), "git::https:/", "")
}

func (sw *SarifWriter) getLocations(name, version, path string, pkgs []ftypes.Package) []location {
Expand Down

0 comments on commit 23b5fec

Please sign in to comment.