object_store/gcp: do not double-percent-encode object paths #7147
+3
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inPathPart::from
, then again inGoogleCloudStorageClient::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?