fix(s3): escape a carriage return in XML responses so a key keeps it (#6598)

* fix(s3): escape a carriage return in XML responses so a key keeps it

* test(s3): share one path-style S3 client between the S3 tests
This commit is contained in:
Niels Kootstra authored and GitHub committed 2026-10-26 16:50:11 -04:00
1 parent b280a7764a
commit 2fd74eaf08
4 files changed
+72 -18

No files matched your search

@@ -83,7 +83,8 @@ public final class XmlBuilder {
}
/**
* Escapes the five XML special characters: {@code & < > " '}.
* Escapes the five XML special characters: {@code & < > " '}, and a carriage return as
* {@code &#13;}, which an XML parser would otherwise read back as a line feed.
* Returns an empty string for null or empty input.
*/
public static String escape(String s) {
@@ -100,6 +101,7 @@ public final class XmlBuilder {
case '>' -> "&gt;";
case '"' -> "&quot;";
case '\'' -> "&apos;";
case '\r' -> "&#13;";
default -> null;
};
if (replacement != null) {