Refactor code structure for improved readability and maintainability; optimize performance in key functions.
This commit is contained in:
@@ -27,7 +27,12 @@ internal static class SbomEndpoints
|
||||
scansGroup.MapPost("/{scanId}/sbom", HandleSubmitSbomAsync)
|
||||
.WithName("scanner.scans.sbom.submit")
|
||||
.WithTags("Scans")
|
||||
.Accepts<JsonDocument>("application/vnd.cyclonedx+json", "application/spdx+json", "application/json")
|
||||
.Accepts<JsonDocument>(
|
||||
"application/vnd.cyclonedx+json; version=1.7",
|
||||
"application/vnd.cyclonedx+json; version=1.6",
|
||||
"application/vnd.cyclonedx+json",
|
||||
"application/spdx+json",
|
||||
"application/json")
|
||||
.Produces<SbomAcceptedResponseDto>(StatusCodes.Status202Accepted)
|
||||
.Produces(StatusCodes.Status400BadRequest)
|
||||
.Produces(StatusCodes.Status404NotFound)
|
||||
@@ -96,7 +101,7 @@ internal static class SbomEndpoints
|
||||
ProblemTypes.Validation,
|
||||
"Unknown SBOM format",
|
||||
StatusCodes.Status400BadRequest,
|
||||
detail: "Could not detect SBOM format. Use Content-Type 'application/vnd.cyclonedx+json' or 'application/spdx+json'.");
|
||||
detail: "Could not detect SBOM format. Use Content-Type 'application/vnd.cyclonedx+json; version=1.7' (or 1.6) or 'application/spdx+json'.");
|
||||
}
|
||||
|
||||
// Validate the SBOM
|
||||
|
||||
Reference in New Issue
Block a user