Skip to content

Upload misses implementation for a few headers #8020

Description

@chrisguttandin

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

  • Select this option if this issue appears to be a regression.

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.

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issue

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions