Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

/api/v1/scan/{scan_request_id}/report should send http 400 when the sbom_media_type is missed for sbom scan #444

Open
stonezdj opened this issue Feb 24, 2024 · 1 comment

Comments

@stonezdj
Copy link

What steps did you take and what happened:

After send a SBOM request to /api/v1/scan
and the subsequent request to retrieve the sbom
GET /api/v1/scan/{scan_request_id}/report?sbom_media_type=xxxx, if the sbom_media_type is missed in the parameter
Current return code is 404 not found.

What did you expect to happen:

The API should return 400 to the client and also log the error message in the trivy.log so that user could diagnostic the current issue, the error message should like that: the sbom_media_type is missed for sbom scan report

Environment:

  • Harbor version: v2.10.0
  • Harbor Scanner Adapter for Trivy version: sbom prototype
  • Harbor installation process: docker-compose
@knqyf263
Copy link
Collaborator

Fixed in f9211e6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants