-
Notifications
You must be signed in to change notification settings - Fork 646
Closed
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
Starting in version 3.931.0 of @aws-sdk/client-s3, the PutObjectCommand is unexpectedly prepending <?xml version="1.0" encoding="UTF-8"?> to documents when the ContentType is set to application/xml.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v24.11.0
Reproduction Steps
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
const client = new S3Client({ region: "us-east-1" });
const xmlContent = `<?xml version="1.0" encoding="UTF-8"?><root><element>test</element></root>`;
const command = new PutObjectCommand({
Bucket: "my-bucket",
Key: "test.xml",
Body: xmlContent,
ContentType: "application/xml",
});
await client.send(command);
// Downloaded content will have additional XML declaration prependedObserved Behavior
The uploaded document has <?xml version="1.0" encoding="UTF-8"?> prepended to the original content.
Expected Behavior
The uploaded document should contain exactly the content provided, without any XML declaration prepended.
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.