fix: correctly encode + chars in storage location URLs in case of AWS - #2011
Merged
Conversation
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.