You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ck...@apache.org on 2020/08/28 12:05:43 UTC
[httpcomponents-client] branch master updated: HTTPCLIENT-2112:
AbstractMultipartFormat respects ByteBuffer.arrayOffset (#253)
This is an automated email from the ASF dual-hosted git repository.
ckozak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
The following commit(s) were added to refs/heads/master by this push:
new 45c45d5 HTTPCLIENT-2112: AbstractMultipartFormat respects ByteBuffer.arrayOffset (#253)
45c45d5 is described below
commit 45c45d53e0e3ad9c5adccf4af8404981c69d2c3c
Author: Carter Kozak <ck...@apache.org>
AuthorDate: Fri Aug 28 08:05:32 2020 -0400
HTTPCLIENT-2112: AbstractMultipartFormat respects ByteBuffer.arrayOffset (#253)
---
.../org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
index 9e903bc..66b373b 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/AbstractMultipartFormat.java
@@ -50,7 +50,7 @@ abstract class AbstractMultipartFormat {
final Charset charset, final String string) {
final ByteBuffer encoded = charset.encode(CharBuffer.wrap(string));
final ByteArrayBuffer bab = new ByteArrayBuffer(encoded.remaining());
- bab.append(encoded.array(), encoded.position(), encoded.remaining());
+ bab.append(encoded.array(), encoded.arrayOffset() + encoded.position(), encoded.remaining());
return bab;
}