Commit 8029b133 by John Chen Committed by GitHub

fix(s3): use Buffer instead of string for health check body (#6913)

When using ali-oss as STORAGE_VENDOR, the `put()` method treats string
  body as a file path and calls `fs.statSync()` on it. Passing `'ok'`
  causes `ENOENT: no such file or directory, stat 'ok'` during
  instrumentation-check, crashing the server on startup.

  Using `Buffer.from('ok')` ensures all adapters (aws-s3, minio, cos, oss)
  handle the body as content rather than a file path.
parent a1d56ced
......@@ -73,7 +73,7 @@ export class S3BaseBucket {
await this.client.uploadObject({
key,
body: 'ok',
body: Buffer.from('ok'),
contentType: 'text/plain',
metadata: {
contentDisposition: getContentDisposition({ filename, type: 'attachment' }),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment