Skip to content

Commit b3d20b1

Browse files
committed
Backport minor MultipartUtils:: computeContentType clean up
Motivation: 5b0e807 introduced a minor clean up on `MultipartUtils:: computeContentType `. Modification: Backport code Result: Code aligned
1 parent 26e7372 commit b3d20b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/src/main/java/org/asynchttpclient/request/body/multipart/MultipartUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ private static byte[] generateBoundary() {
104104
return bytes;
105105
}
106106

107-
private static String computeContentType(String base, byte[] boundary) {
107+
private static String computeContentType(CharSequence base, byte[] boundary) {
108108
StringBuilder buffer = StringUtils.stringBuilder().append(base);
109-
if (!base.endsWith(";"))
109+
if (base.length() != 0 && base.charAt(base.length() - 1) != ';')
110110
buffer.append(';');
111111
return buffer.append(" boundary=").append(new String(boundary, US_ASCII)).toString();
112112
}

0 commit comments

Comments
 (0)