Merge pull request #10229 from steven-zou/fix/bug_#10108

fix[scan]:missing header in v1 client
This commit is contained in:
Steven Zou 2019-12-11 20:28:01 +08:00 committed by GitHub
commit a9bd086b2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,6 +158,9 @@ func (c *basicClient) SubmitScan(req *ScanRequest) (*ScanResponse, error) {
return nil, errors.Wrap(err, "v1 client: submit scan") return nil, errors.Wrap(err, "v1 client: submit scan")
} }
// Resolve header
def.Resolver(request)
respData, err := c.send(request, generalResponseHandler(http.StatusAccepted)) respData, err := c.send(request, generalResponseHandler(http.StatusAccepted))
if err != nil { if err != nil {
return nil, errors.Wrap(err, "v1 client: submit scan") return nil, errors.Wrap(err, "v1 client: submit scan")
@ -188,6 +191,9 @@ func (c *basicClient) GetScanReport(scanRequestID, reportMIMEType string) (strin
return "", errors.Wrap(err, "v1 client: get scan report") return "", errors.Wrap(err, "v1 client: get scan report")
} }
// Resolve header
def.Resolver(req)
respData, err := c.send(req, reportResponseHandler()) respData, err := c.send(req, reportResponseHandler())
if err != nil { if err != nil {
// This error should not be wrapped // This error should not be wrapped