mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-26 10:38:00 +01:00
fix(scan): returns 400 when artifact not support by scanner (#13785)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
164acad24f
commit
792dcc4ac3
@ -548,6 +548,8 @@ paths:
|
||||
responses:
|
||||
'202':
|
||||
$ref: '#/responses/202'
|
||||
'400':
|
||||
$ref: '#/responses/400'
|
||||
'401':
|
||||
$ref: '#/responses/401'
|
||||
'403':
|
||||
|
@ -192,7 +192,7 @@ func (bc *basicController) Scan(ctx context.Context, artifact *ar.Artifact, opti
|
||||
}
|
||||
|
||||
if !scannable {
|
||||
return errors.Errorf("the configured scanner %s does not support scanning artifact with mime type %s", r.Name, artifact.ManifestMediaType)
|
||||
return errors.BadRequestError(nil).WithMessage("the configured scanner %s does not support scanning artifact with mime type %s", r.Name, artifact.ManifestMediaType)
|
||||
}
|
||||
|
||||
type Param struct {
|
||||
|
Loading…
Reference in New Issue
Block a user