parse-community / parse-community/parse-server-s3-adapter

Improve URL encoding in createFile() Location field

Open
#461 0 comments 0 reactions 1 assignee View on GitHub

@mtrezza is already working on this.

Since Feb 21, 2026.

Dominant language
JavaScript
Stars
80
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Background

The Location field returned by createFile() in index.js currently uses raw params.Key without URL encoding. This is pre-existing behavior that should be improved to properly handle filenames with special characters (e.g., spaces, parentheses).

Problem

Filenames with spaces or special characters (e.g., my file (1).txt) produce technically malformed URLs in the Location field:

  • Current: https://bucket.s3.region.amazonaws.com/my file (1).txt
  • Expected: https://bucket.s3.region.amazonaws.com/my%20file%20(1).txt

Solution

Apply proper URL encoding to params.Key when constructing the Location URL, using:

params.Key.split('/').map(encodeURIComponent).join('/')

This matches the logic already used in getFileLocation() and avoids encoding path separators.

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.