Checkboxes for prior research
Describe the bug
I'm trying to use Upload from lib-storage with the IfNoneMatch param. It throws an error saying that it is not yet implemented.
Regression Issue
SDK version number
@aws-sdk/lib-storage@3.1044.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v22.22.2
Reproduction Steps
This will trigger the error:
import { S3Client } from '@aws-sdk/client-s3';
import { Upload } from '@aws-sdk/lib-storage';
const s3Client = new S3Client(/* ... */);
const upload = new Upload({ client: s3Client, params: { Body, Bucket: '...', IfNoneMatch: '*', Key: '...' } });
await upload.done();
Observed Behavior
It will throw an error.
Expected Behavior
I think this could be implemented.
Possible Solution
It looks like the params are internally handled already. The Body for example gets replaced ...
|
const params = { ...this.params, Body: dataPart.data }; |
... or set to undefined ...
|
const createCommandParams = { ...this.params, Body: undefined }; |
... if necessary. I think a similar thing could be done for the params that should only be set for the PutObjectCommand and CompleteMultipartUploadCommand respectively.
Additional Information/Context
I'm happy to provide PR for this if it helps.
Checkboxes for prior research
Describe the bug
I'm trying to use
Uploadfromlib-storagewith theIfNoneMatchparam. It throws an error saying that it is not yet implemented.Regression Issue
SDK version number
@aws-sdk/lib-storage@3.1044.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v22.22.2
Reproduction Steps
This will trigger the error:
Observed Behavior
It will throw an error.
Expected Behavior
I think this could be implemented.
Possible Solution
It looks like the
paramsare internally handled already. TheBodyfor example gets replaced ...aws-sdk-js-v3/lib/lib-storage/src/Upload.ts
Line 146 in a664335
... or set to undefined ...
aws-sdk-js-v3/lib/lib-storage/src/Upload.ts
Line 227 in a664335
... if necessary. I think a similar thing could be done for the params that should only be set for the
PutObjectCommandandCompleteMultipartUploadCommandrespectively.Additional Information/Context
I'm happy to provide PR for this if it helps.