We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d83a14 commit 99fbf9bCopy full SHA for 99fbf9b
packages/web-backend/src/S3Buckets/index.ts
@@ -45,8 +45,18 @@ export class S3Buckets extends Effect.Service<S3Buckets>()("S3Buckets", {
45
requestStreamBufferSize: 16 * 1024,
46
});
47
48
- const endpointIsPathStyle = (endpoint: string) =>
49
- endpoint.endsWith("s3.amazonaws.com");
+ const endpointIsPathStyle = (endpoint: string) => {
+ try {
50
+ const { hostname } = new URL(endpoint);
51
+ return (
52
+ hostname === "s3.amazonaws.com" ||
53
+ hostname.endsWith(".s3.amazonaws.com")
54
+ );
55
+ } catch {
56
+ // If endpoint can't be parsed as a URL, fall back to false for safety
57
+ return false;
58
+ }
59
+ };
60
61
const createBucketClient = async (bucket: S3Bucket.S3Bucket) => {
62
const endpoint = await (() => {
0 commit comments