diff --git a/src/storage/s3.js b/src/storage/s3.js index 92151889a..e20d93651 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -69,7 +69,8 @@ function createS3Client(apiConfig, options) { forcePathStyle: apiConfig.s3ForcePathStyle === true ? true : false, // Use vhost style instead of path style - https://forums.aws.amazon.com/ann.jspa?annID=6776 region: apiConfig.region || 'us-east-1', credentials, - requestHandler: requestHandler + requestHandler, + // logger: console }; if (options.retryStrategy) clientConfig.retryStrategy = options.retryStrategy; @@ -85,7 +86,22 @@ function createS3Client(apiConfig, options) { requestHandler.agent = new http.Agent({}); } - return constants.TEST ? new globalThis.S3Mock(clientConfig) : new S3(clientConfig); + const client = constants.TEST ? new globalThis.S3Mock(clientConfig) : new S3(clientConfig); + // https://github.com/aws/aws-sdk-js-v3/issues/6761#issuecomment-2574480834 + // client.middlewareStack.add((next, context) => async (args) => { + // debug('AWS SDK context', context.clientName, context.commandName); + // debug('AWS SDK request input', JSON.stringify(args.input)); + // const result = await next(args); + // console.log('AWS SDK request output:', result.output); + // return result; + // }, + // { + // name: 'MyMiddleware', + // step: 'build', + // override: true, + // }); + + return client; } async function getAvailableSize(apiConfig) {