Skip to content

Commit 46e90de

Browse files
committed
Port changes from 1.7.x.
1 parent 6c90e25 commit 46e90de

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

api/src/main/java/org/asynchttpclient/generators/InputStreamBodyGenerator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public InputStreamBodyGenerator(InputStream inputStream) {
4343
if (inputStream.markSupported()) {
4444
inputStream.mark(0);
4545
} else {
46-
logger.info("inputStream.markSupported() not supported. Some features will not works");
46+
logger.info("inputStream.markSupported() not supported. Some features will not work.");
4747
}
4848
}
4949

@@ -117,6 +117,10 @@ public long read(ByteBuffer buffer) throws IOException {
117117
} else {
118118
if (read > 0) {
119119
buffer.put(chunk, 0, read);
120+
} else {
121+
if (inputStream.markSupported()) {
122+
inputStream.reset();
123+
}
120124
}
121125
}
122126
return read;

api/src/test/java/org/asynchttpclient/async/BasicAuthTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public AbstractHandler configureHandler() throws Exception {
472472
return new SimpleHandler();
473473
}
474474

475-
@Test(groups = { "standalone", "default_provider" }, enabled = false)
475+
@Test(groups = { "standalone", "default_provider" })
476476
public void stringBuilderBodyConsumerTest() throws Throwable {
477477

478478
SimpleAsyncHttpClient client = new SimpleAsyncHttpClient.Builder().setRealmPrincipal(user).setRealmPassword(admin).setUrl(getTargetUrl()).setHeader("Content-Type", "text/html").build();

0 commit comments

Comments
 (0)