Skip to content

Commit 73db823

Browse files
fix s3 endpoint resolution issue in new SDK version (#1397)
1 parent fbc7998 commit 73db823

File tree

6 files changed

+4525
-4124
lines changed

6 files changed

+4525
-4124
lines changed

build.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ function defaultEndpointResolver(endpointParams, context = {}) {
252252
const { hostname, protocol, pathname, search } = endpoint.url;
253253
const [bucket, host] = hostname.split(".s3.");
254254
if (host) {
255-
const newHref = `${protocol}//s3.${host}/${bucket}${pathname}${
255+
const path = pathname === "/" ? "" : pathname;
256+
const newHref = `${protocol}//s3.${host}/${bucket}${path}${
256257
search ? `?${search}` : ""
257258
}`;
258259
endpoint.url.href = newHref;

example/functions/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
"build": "node build.mjs"
88
},
99
"dependencies": {
10-
"@aws-sdk/client-dynamodb": "3.901.0",
11-
"@aws-sdk/client-ec2": "3.901.0",
12-
"@aws-sdk/client-s3": "3.901.0",
13-
"aws-sdk": "2.1692.0",
10+
"@aws-sdk/client-dynamodb": "3.991.0",
11+
"@aws-sdk/client-ec2": "3.991.0",
12+
"@aws-sdk/client-s3": "3.991.0",
13+
"aws-sdk": "2.1693.0",
1414
"esbuild-css-modules-plugin": "3.1.5",
1515
"react": "19.2.4",
1616
"react-dom": "19.2.4"
1717
},
1818
"devDependencies": {
19-
"@types/react": "19.2.13",
19+
"@types/react": "19.2.14",
2020
"@types/react-dom": "19.2.3",
21-
"esbuild": "0.25.11"
21+
"esbuild": "0.27.3"
2222
}
2323
}

0 commit comments

Comments
 (0)