Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object_store/gcp: do not double-percent-encode object paths #7147

Closed
wants to merge 1 commit into from

Conversation

james-rms
Copy link
Contributor

@james-rms james-rms commented Feb 18, 2025

Closes #7148.

Rationale for this change

Right now the object_store crate can't read an object in GCS with name [foo].

GoogleCloudStorage::get(&Path::from("[foo]") will see the object name percent encoded once in PathPart::from, then again in GoogleCloudStorageClient::object_url, and the resulting request URL will be double-encoded %255Bfoo%255D instead of %5Bfoo%5D.

This double-encoding seems like a bug to me. It probably doesn't affect clients who exclusively use the object_store crate (since the double encoding happens on read and write) but for those operating across multiple clients, this is a serious issue.

Fixing this bug will introduce a backwards-compatibility issue for users who have written double-encoded object paths into GCS using object_store. If this is not acceptable, I can add an option into the client and client builder to enable or disable this behavior.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the object-store Object Store Interface label Feb 18, 2025
@james-rms james-rms closed this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

object_store: GCP object store cannot read objects with special characters in path
1 participant