Support quoted boundary in DefaultPartHttpMessageReader

This commit makes sure that quoted boundary parameters are supported in
the DefaultPartHttpMessageReader.

Closes gh-26616
This commit is contained in:
Arjen Poutsma
2021-03-01 14:07:20 +01:00
parent 4af7a6863b
commit 1a79c54b01
2 changed files with 23 additions and 0 deletions

View File

@@ -227,6 +227,10 @@ public class DefaultPartHttpMessageReader extends LoggingCodecSupport implements
if (contentType != null) {
String boundary = contentType.getParameter("boundary");
if (boundary != null) {
int len = boundary.length();
if (len > 2 && boundary.charAt(0) == '"' && boundary.charAt(len - 1) == '"') {
boundary = boundary.substring(1, len - 1);
}
return boundary.getBytes(StandardCharsets.ISO_8859_1);
}
}