Skip to content

Commit 5e0465b

Browse files
committed
Merge branch 'fix/url-safe' into 'develop'
Fix/url safe See merge request genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator!217
2 parents a4707ff + 3047a7e commit 5e0465b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ SPDX-License-Identifier: MIT-0
9090
- Fixed UI list deletion issue where empty lists were not saved correctly - #18
9191
- Improve structure and clarity for idp_common Python package documentation
9292
- Improved UI in View/Edit Configuration to clarify that Class and Attribute descriptions are used in the classification and extraction prompts
93-
- Automate UI updates for field "HITL (A2I) Status" in the Document list and document details section.
93+
- Automate UI updates for field "HITL (A2I) Status" in the Document list and document details section.
94+
- Fixed image display issue in PagesPanel where URLs containing special characters (commas, spaces) would fail to load by properly URL-encoding S3 object keys in presigned URL generation
9495

9596
## [0.3.6]
9697

src/ui/src/components/common/generate-s3-presigned-url.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ const generateS3PresignedUrl = async (url, credentials) => {
6363
// Extract region from env
6464
const region = process.env.REACT_APP_AWS_REGION;
6565

66-
// Construct the canonical S3 URL
67-
const newUrl = `https://${bucketName}.s3.${region}.amazonaws.com/${key}`;
66+
// Construct the canonical S3 URL with properly encoded key
67+
const encodedKey = key
68+
.split('/')
69+
.map((segment) => encodeURIComponent(segment))
70+
.join('/');
71+
const newUrl = `https://${bucketName}.s3.${region}.amazonaws.com/${encodedKey}`;
6872

6973
// Parse the URL for the presigner
7074
const s3ObjectUrl = parseUrl(newUrl);

0 commit comments

Comments
 (0)