mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
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:
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 }, 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 '>' -> ">";
|
||||
case '"' -> """;
|
||||
case '\'' -> "'";
|
||||
case '\r' -> " ";
|
||||
default -> null;
|
||||
};
|
||||
if (replacement != null) {
|
||||
|
||||
Reference in new issue
Block a user