fix: preserve trailing slashes in normalizeUri for SigV4
Deploy FileDrop / deploy (push) Successful in 36s

The empty-segment skip in normalizeUri (introduced in round 1 fix)
was stripping trailing slashes from canonical URIs, e.g. /bucket/
became /bucket. The AWS SDK signs with the trailing slash intact, so
signatures never matched for any S3 operation with a body.

The fix: only skip '.' segments (dot-segment removal per RFC 3986),
preserve all other segments including empty ones from trailing
slashes and double slashes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude
2026-07-29 09:14:18 +07:00
parent c18b9d265b
commit cd9852a5ec
2 changed files with 10 additions and 11 deletions
@@ -152,6 +152,7 @@ export const handleS3Request = async (
const method = req.method;
const url = new URL(req.url);
const pathname = url.pathname;
if (pathname !== '/') console.error('S3_REQ:' + method + ' ' + pathname);
const { bucket, key } = virtualHostBucket
? {
bucket: virtualHostBucket,