Skip to content

Commit

Permalink
fix path parser
Browse files Browse the repository at this point in the history
  • Loading branch information
freeznet committed Feb 26, 2025
1 parent 5b3d1d4 commit bce9789
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/connection/reconcile_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,13 @@ func downloadCloudStorage(ctx context.Context, fileURL string, tmpFile *os.File)
return "", fmt.Errorf("invalid URL: %v", err)
}

objectKey := parsedURL.Path
if len(objectKey) > 0 && objectKey[0] == '/' {
objectKey = objectKey[1:] // Remove the leading slash
}

// Get the object
reader, err := bucket.NewReader(ctx, parsedURL.Path, nil)
reader, err := bucket.NewReader(ctx, objectKey, nil)
if err != nil {
return "", fmt.Errorf("failed to create reader: %v", err)
}
Expand Down

0 comments on commit bce9789

Please sign in to comment.