Skip to content

Object keys are not URL-encoded in multipart upload methods #13

@Nana-EC

Description

@Nana-EC

Description

uploadTextFile() and downloadTextFile() correctly call urlEncode(key, true) when
building their request URLs. However, createMultipartUpload(), multipartUploadPart(),
completeMultipartUpload(), and abortMultipartUpload() concatenate the object key directly
into the URL without encoding. Object keys containing spaces, +, #, or other reserved
characters will produce malformed URLs, incorrect SigV4 signatures, and failed requests.

Steps to reproduce

  1. Call uploadFile() with an objectKey containing a space (e.g., "my folder/file.txt").
  2. The internally called createMultipartUpload() constructs:
    endpoint + bucketName + "/" + key + "?uploads="
    The space is not encoded, producing a broken URL.

Expected behavior
All methods that embed an object key in a URL should call urlEncode(key, true).

Actual behavior
Keys with special characters produce malformed URLs and authentication failures.

Affected file
client/src/main/java/com/hedera/bucky/S3Client.java — lines ~436, ~481, ~530, ~400

Additional context

No response

Hedera network

No response

Version

v0.1.0

Operating system

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA error that causes the feature to behave differently than what was expected based on design docs

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions