Skip to content

Double url-encoding of special characters in key names #457

@Noratrieb

Description

@Noratrieb

Describe the bug

I have tried to use the object_store crate to upload files to my S3-compatible garage store.

As a key name, I tried using /mäggi.png.
But afterwards, I was not able to access this file.

In the logs for garage, it logged that it received this request: PUT /$bucketname/m%25C3%25A4ggi.txt.
This is a double encoding, which it decoded to /m%C3%A4ggi.txt and used that as the stored filename.

I have not tried reproducing the problem with another object store like Amazon S3 or MinIO, but I have tried uploading /mäggi.png using minio-client (mc cp), which worked fine, which makes me believe that garage behaves as expected. It is not impossible that this is a problem in garage though.

To Reproduce

Use object_store AWS client with put_object with a key name of /mäggi.png with the garage object store.

Expected behavior

The object store receives the key name as mäggi.png and stores that file name.

Additional context

It's encoded when constructing the path string.

While it's then later encoded again since the path string is passed to the request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions