Skip to content

Commit 29f89da

Browse files
committed
Add GetObjectAttributes functional test for non-existent user metadata
Issue: CLDSRV-868
1 parent 5ce779e commit 29f89da

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/functional/aws-node-sdk/test/object/objectGetAttributes.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,25 @@ describe('objectGetAttributes with user metadata', () => {
374374
assert.strictEqual(response['x-amz-meta-nonexistent'], undefined);
375375
});
376376

377+
it('should return empty response when only a non-existing metadata key is requested', async () => {
378+
await s3.send(new PutObjectCommand({
379+
Bucket: bucket,
380+
Key: key,
381+
Body: body,
382+
Metadata: {
383+
existing: 'value',
384+
},
385+
}));
386+
387+
const response = await s3.send(new GetObjectAttributesExtendedCommand({
388+
Bucket: bucket,
389+
Key: key,
390+
ObjectAttributes: ['x-amz-meta-nonexistent'],
391+
}));
392+
393+
assert.strictEqual(response['x-amz-meta-nonexistent'], undefined);
394+
});
395+
377396
it('should return user metadata along with standard attributes', async () => {
378397
await s3.send(new PutObjectCommand({
379398
Bucket: bucket,

0 commit comments

Comments
 (0)