You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In parser.go, the params-building loop converts any empty-string query-parameter value to "1" using the comment "bare key (e.g. ?uploads, ?versions)". However, Go's r.ParseForm() cannot distinguish a true bare key (?uploads) from a key with an explicitly empty value (?prefix=) — both produce an empty string value. As a result, prefix= is stored as prefix=1, which breaks ListObjectsV2 when the AWS SDK sends an explicit empty prefix.
Reproduction
// AWS SDK Go v2 sends: GET /<bucket>?list-type=2&prefix=&delimiter=%2F// When Prefix: aws.String("") is passed to ListObjectsV2Input.s3c.ListObjectsV2(ctx, &s3.ListObjectsV2Input{
Bucket: aws.String("my-bucket"),
Prefix: aws.String(""), // explicitly emptyDelimiter: aws.String("/"),
})
// Returns: CommonPrefixes=[] Contents=[] — all objects filtered out// Expected: CommonPrefixes=[...] based on delimiter grouping
?prefix= → r.Form["prefix"] = [""] → converted to "1".
In listObjectsV2: prefix = "1", filtering out all objects that don't start with "1".
Fix
Parse r.URL.RawQuery manually to distinguish true bare keys (no = sign) from empty-value keys (have =):
// Only upgrade to "1" when the raw query actually has no "=" for this key.barKeys:=parseBareKeys(r.URL.RawQuery) // set of keys with no "="fork, vs:=ranger.Form {
v:=""iflen(vs) >0 { v=vs[0] }
ifv==""&&barKeys[k] { v="1" }
params[k] =v
}
Alternatively, only apply the bare-key heuristic for a known whitelist of S3 operation keys: uploads, delete, acl, tagging, versioning, versions, notification, lifecycle, policy, cors.
Context
Discovered while running Canopy integration tests. TestIntegration_S3_BrowseObjects calls liveBrowseObjects → ListObjectsV2 with Prefix: aws.String("") → prefix= in query → filtered to nothing.
Workaround applied in Canopy: omit Prefix from the input when it's empty string (use nil instead of aws.String("")). But this is a latent substrate bug that will affect any other AWS SDK client sending empty-string query parameters.
Fixed in v0.36.5. The raw query string is now inspected to build an explicitEmpty set before iterating r.Form, so keys like ?prefix= are correctly preserved as "" while true bare keys like ?uploads continue to map to "1".
Activity
scttfrdmn commentedon Mar 18, 2026
Fixed in v0.36.5. The raw query string is now inspected to build an
explicitEmptyset before iteratingr.Form, so keys like?prefix=are correctly preserved as""while true bare keys like?uploadscontinue to map to"1".fix(ec2): RunInstances must reject a launch that resolves no AMI (#412)…