[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153786#comment-17153786
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-2098:
-----------------------------------------------

[~amah] Would you be willing to create a PR at GitHub with the test case and a 
fix?

Oleg

> maxResultLength parameter no effect on reading HttpEntity
> ---------------------------------------------------------
>
>                 Key: HTTPCLIENT-2098
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2098
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 5.0.1
>            Reporter: Andriy
>            Priority: Minor
>              Labels: security
>
> maxResultEffect seems to have no effect on the 
> org.apache.hc.core5.http.io.entity.EntityUtils#toByteArray(org.apache.hc.core5.http.HttpEntity,
>  int) method.
> [https://github.com/apache/httpcomponents-core/blob/5.1.x/httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/EntityUtils.java#L149]
>  
> Test (passing) to reproduce the error:
> {code:java}
> @Test
> public void testMaxResultLengthNoEffect() throws IOException {
>     String random = org.apache.commons.lang3.RandomStringUtils.random(5000, 
> true, true);
>     byte[] bytes = org.apache.hc.core5.http.io.entity.EntityUtils.toByteArray(
>             new org.apache.hc.core5.http.io.entity.StringEntity(random)
>             , (int) Math.pow(10, 3));
>     String s = new String(bytes);
>     Assert.assertEquals(random,s);
> }
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to