Skip to content

Commit f9245de

Browse files
authored
fix(core/protocols): conditionally append xml declaration (#7551)
1 parent abaca49 commit f9245de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/submodules/protocols/xml/AwsRestXmlProtocol.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
7272

7373
if (request.headers["content-type"] === this.getDefaultContentType()) {
7474
if (typeof request.body === "string") {
75-
request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
75+
if (!request.body.startsWith("<?xml ")) {
76+
request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
77+
}
7678
}
7779
}
7880

0 commit comments

Comments
 (0)