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) ListFiles(ctx context.Context, rawpath string) ([]byte, error
return list, err
}
contentLength := resp.Header.Get("Content-Length")
if contentLength == "" {
err := fmt.Errorf("Content-Length header is missing")
return list, err
}
blobSize, err := strconv.ParseInt(contentLength, 10, 64)
if err != nil {
return list, err
@@ -45,7 +49,7 @@ func (cli *Client) ListFiles(ctx context.Context, rawpath string) ([]byte, error
buffer := bytes.NewBuffer(nil)
recSize, err := Copy(ctx, buffer, 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 list, err
}
list = buffer.Bytes()