Skip to content

Commit

Permalink
feat(server): improve logging
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <[email protected]>
  • Loading branch information
setchy committed Jul 25, 2024
1 parent be4e4f4 commit 3a33279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ const start = (options) => {
let bomNSData = (await createBom(srcDir, reqOptions)) || {};
bomNSData = postProcess(bomNSData, reqOptions);
if (reqOptions.serverUrl && reqOptions.apiKey) {
console.log("Publishing SBOM to Dependency Track");
console.log(`Publishing SBOM ${reqOptions.projectName} to Dependency Track`, reqOptions.serverUrl);

Check failure

Code scanning / CodeQL

Use of externally-controlled format string High

Format string depends on a
user-provided value
.
Format string depends on a
user-provided value
.
const response = await submitBom(reqOptions, bomNSData.bomJson);
const errorMessages = response?.errors;
if (errorMessages) {
res.writeHead(500, { "Content-Type": "application/json" });
return res.end(
JSON.stringify({
error: "Unable to submit the SBOM to the Dependency-Track server",
error: `Unable to submit the SBOM ${reqOptions.projectName} to the Dependency Track server ${reqOptions.serverUrl}`,
details: errorMessages,
}),
);
Expand Down

0 comments on commit 3a33279

Please sign in to comment.