add accntcli

This commit is contained in:
2026-03-07 19:11:20 +02:00
parent 46bcc465ee
commit efdabf3efc
23 changed files with 698 additions and 96 deletions
+5 -1
View File
@@ -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