I came here because of this bug:
2026-07-22T14:17:59.244Z Command {
"Bucket": "someProject",
"Key": "post/205ef9cd-54ac-4cdf-b400-d985d6315a02.webp",
"ContentType": "image/webp",
"ACL": "public-read"
}
2026-07-22T14:17:59.269Z Upload failed: post/205ef9cd-54ac-4cdf-b400-d985d6315a02.webp
2026-07-22T14:17:59.269Z TypeError: endpoint.headers[name].join is not a function
at toEndpointV1 (/home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js:164:85)
at Object.endpoint (/home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js:85:23)
at S3RestXmlProtocol.serializeRequest (/home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js:189:40)
at S3RestXmlProtocol.serializeRequest (/home/someUser/someProject/adminApi/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js:1821:37)
at S3RestXmlProtocol.serializeRequest (/home/someUser/someProject/adminApi/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js:495:37)
at /home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js:87:43
at /home/someUser/someProject/adminApi/node_modules/@aws-sdk/checksums/dist-cjs/submodules/flexible-checksums/index.js:293:12
at async /home/someUser/someProject/adminApi/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js:62:28
at async /home/someUser/someProject/adminApi/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js:89:20
at async /home/someUser/someProject/adminApi/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js:125:26
at async Object.upload (file:///home/someUser/someProject/adminApi/node_modules/core/cloud/aws/storage.js:75:13)
at async Object.uploadImage (file:///home/someUser/someProject/adminApi/node_modules/core/data/storage/storage.js:111:9)
at async uploadImage (file:///home/someUser/someProject/adminApi/node_modules/media/business/image/upload.js:20:5)
at async uploadDefaultOnPost (file:///home/someUser/someProject/adminApi/node_modules/media/business/image/upload.js:54:5)
at async handleAction (file:///home/someUser/someProject/adminApi/node_modules/core/api/actionHandler.js:139:18)
at async file:///home/someUser/someProject/adminApi/node_modules/core/api/typeRoute.js:27:26
2026-07-22T14:17:59.271Z TypeError: endpoint.headers[name].join is not a function
at toEndpointV1 (/home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js:164:85)
at Object.endpoint (/home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js:85:23)
at S3RestXmlProtocol.serializeRequest (/home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js:189:40)
at S3RestXmlProtocol.serializeRequest (/home/someUser/someProject/adminApi/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js:1821:37)
at S3RestXmlProtocol.serializeRequest (/home/someUser/someProject/adminApi/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js:495:37)
at /home/someUser/someProject/adminApi/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js:87:43
at /home/someUser/someProject/adminApi/node_modules/@aws-sdk/checksums/dist-cjs/submodules/flexible-checksums/index.js:293:12
at async /home/someUser/someProject/adminApi/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js:62:28
at async /home/someUser/someProject/adminApi/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js:89:20
at async /home/someUser/someProject/adminApi/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js:125:26
at async Object.upload (file:///home/someUser/someProject/adminApi/node_modules/core/cloud/aws/storage.js:75:13)
at async Object.uploadImage (file:///home/someUser/someProject/adminApi/node_modules/core/data/storage/storage.js:111:9)
at async uploadImage (file:///home/someUser/someProject/adminApi/node_modules/media/business/image/upload.js:20:5)
at async uploadDefaultOnPost (file:///home/someUser/someProject/adminApi/node_modules/media/business/image/upload.js:54:5)
at async handleAction (file:///home/someUser/someProject/adminApi/node_modules/core/api/actionHandler.js:139:18)
at async file:///home/someUser/someProject/adminApi/node_modules/core/api/typeRoute.js:27:26
Here is the method that causes this bug:
const toEndpointV1 = (endpoint) => {
console.log(endpoint)
if (typeof endpoint === "object") {
if ("url" in endpoint) {
const v1Endpoint = parseUrl(endpoint.url);
if (endpoint.headers) {
v1Endpoint.headers = {};
for (const name in endpoint.headers) {
console.log(name)
v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
}
}
return v1Endpoint;
}
return endpoint;
}
return parseUrl(endpoint);
};
Please note that console.log lines are mine. And here is the endpoint:
{
url: URL {
href: 'https://s3.ir-thr-at1.arvanstorage.ir/jzp',
origin: 'https://s3.ir-thr-at1.arvanstorage.ir',
protocol: 'https:',
username: '',
password: '',
host: 's3.ir-thr-at1.arvanstorage.ir',
hostname: 's3.ir-thr-at1.arvanstorage.ir',
port: '',
pathname: '/jzp',
search: '',
searchParams: URLSearchParams {},
hash: ''
},
properties: { authSchemes: [ [Object] ] },
headers: {}
}
And here is the name of the first property that causes this error:
This is a custom property that we have added to all objects in our codebase:
Object.prototype.sortByKeys = function () {
const sortedKeys = Object.keys(this).sort()
const sortedObject = {}
for (const key of sortedKeys) {
sortedObject[key] = this[key]
}
return sortedObject
}
So, I think you should make your property-transferring logic limited to the object itself and not prototypically inherited properties:
for (const name in endpoint.headers) {
if (!Object.hasOwn(endpoint.headers, name)) continue
v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ")
}
I came here because of this bug:
Here is the method that causes this bug:
Please note that
console.loglines are mine. And here is theendpoint:And here is the name of the first property that causes this error:
This is a custom property that we have added to all objects in our codebase:
So, I think you should make your property-transferring logic limited to the object itself and not prototypically inherited properties: