Skip to content

Commit

Permalink
Merge pull request #37 from veracode/issue/DXS-378
Browse files Browse the repository at this point in the history
add condition for leading slash
  • Loading branch information
julz0815 authored Apr 2, 2024
2 parents 74bde4c + bc096ef commit 6a1ca6e
Show file tree
Hide file tree
Showing 4 changed files with 601 additions and 4 deletions.
14 changes: 12 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29207,7 +29207,7 @@ class Converter {
let location = {
physicalLocation: {
artifactLocation: {
uri: (0, utils_1.getFilePath)(finding_details.file_path, this.config.replacers)
uri: (0, utils_1.removeLeadingSlash)((0, utils_1.getFilePath)(finding_details.file_path, this.config.replacers))
},
region: {
startLine: finding_details.file_line_number
Expand Down Expand Up @@ -29570,7 +29570,7 @@ function uploadSARIF(outputFilename, opt) {
"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.mapVeracodeSeverityToCVSS = exports.getFilePath = exports.sliceReportLevels = exports.setupSourceReplacement = void 0;
exports.removeLeadingSlash = exports.mapVeracodeSeverityToCVSS = exports.getFilePath = exports.sliceReportLevels = exports.setupSourceReplacement = void 0;
const setupSourceReplacement = (...subs) => {
return subs
.filter(sub => sub && sub.length > 0)
Expand Down Expand Up @@ -29657,6 +29657,16 @@ const mapVeracodeSeverityToCVSS = (severity) => {
}
};
exports.mapVeracodeSeverityToCVSS = mapVeracodeSeverityToCVSS;
const removeLeadingSlash = (str) => {
// Check if the string starts with '/'
if (str.charAt(0) === '/') {
// Remove the leading '/'
return str.substring(1);
}
// If '/' is not present at the first character, return the original string
return str;
};
exports.removeLeadingSlash = removeLeadingSlash;


/***/ }),
Expand Down
Loading

0 comments on commit 6a1ca6e

Please sign in to comment.