Skip to content

fix: correctly encode + chars in storage location URLs in case of AWS - #2011

Merged
netomi merged 2 commits into
mainfrom
fix-storage-url-encoding
Jul 30, 2026
Merged

fix: correctly encode + chars in storage location URLs in case of AWS#2011
netomi merged 2 commits into
mainfrom
fix-storage-url-encoding

Conversation

@netomi

@netomi netomi commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This fixes #1459 and supersedes #1541.

+ is treated by AWS as a space so it must be encoded properly when part of a storage location URL.

It is an allowed character for a semantic version string.

Tested locally with minio as storage backend and it correctly can resolve artifacts with a + sign in them.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes artifact/download and extension page failures for SemVer versions containing + (build metadata) when resources are served from AWS S3 (and potentially via a CDN), by ensuring + is percent-encoded as %2B in URL path contexts where S3 interprets + as space.

Changes:

  • Introduces IStorageService#getObjectKeyAsUrlPath(...) so storage providers can adjust object keys specifically for URL-path usage without changing the underlying stored key.
  • Updates CDN URL generation (StorageUtilService) to use the URL-path form of object keys.
  • Adds unit and integration test coverage for + handling in object keys, CDN URLs, and presigned URLs (AWS).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java Uses getObjectKeyAsUrlPath when constructing CDN-backed locations so AWS paths can encode +.
server/src/main/java/org/eclipse/openvsx/storage/IStorageService.java Adds default URL-path variants of object-key methods to allow provider-specific URL escaping.
server/src/main/java/org/eclipse/openvsx/storage/AwsStorageService.java Overrides URL-path object key generation to encode + as %2B for S3/CDN URL correctness.
server/src/test/java/org/eclipse/openvsx/storage/StorageUtilServiceTest.java Verifies CDN URLs encode + for AWS but keep literal + for other storage types.
server/src/test/java/org/eclipse/openvsx/storage/AwsStorageServiceTest.java Adds focused unit tests ensuring object key remains literal + but URL-path form encodes it.
server/src/test/java/org/eclipse/openvsx/storage/AwsStorageServiceIntegrationTest.java Adds integration coverage asserting presigned URLs include encoded + and remain downloadable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Thomas Neidhart <thomas.neidhart@gmail.com>
@netomi
netomi merged commit 7c4b7da into main Jul 30, 2026
5 checks passed
@netomi
netomi deleted the fix-storage-url-encoding branch July 30, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error processing extensions with a version containing a plus sign

2 participants