add accntcli
This commit is contained in:
@@ -38,6 +38,10 @@ func (cli *Client) GetFile(ctx context.Context, rawpath string, writer io.Writer
|
||||
return exist, err
|
||||
}
|
||||
contentLength := resp.Header.Get("Content-Length")
|
||||
if contentLength == "" {
|
||||
err := fmt.Errorf("Content-Length header is missing")
|
||||
return exist, err
|
||||
}
|
||||
blobSize, err := strconv.ParseInt(contentLength, 10, 64)
|
||||
if err != nil {
|
||||
return exist, err
|
||||
@@ -45,7 +49,7 @@ func (cli *Client) GetFile(ctx context.Context, rawpath string, writer io.Writer
|
||||
|
||||
recSize, err := Copy(ctx, writer, resp.Body)
|
||||
if blobSize != recSize {
|
||||
err := fmt.Errorf("Mismatch declared and actual body size, %d and %d", blobSize, recSize)
|
||||
err := fmt.Errorf("Mismatch declared and actual body size: %d and %d", blobSize, recSize)
|
||||
return exist, err
|
||||
}
|
||||
exist = true
|
||||
|
||||
Reference in New Issue
Block a user