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

Sergey Beryozkin commented on CXF-3304:
---------------------------------------

Hi Jason - thanks for spending the time on it and finding the cause of this 
issue. 
HttpURLConnection.setChunkedStreamingMode(-1) works well for the usual cases, 
so I guess what we can do is to configure the policy: either disable the 
chunking or set the chunkedStreamingMode to something different, to 2048 or 
similar...

You can do it like this:

WebClient.getConfig(client).getHttpConduit().getClient().setAllowChunking(false);

WebClient.getConfig(client).getHttpConduit().getClient().setChunkedStreamingMode(2048);


WebClient.getConfig(client) works for web clients and proxies.

So may be if you can confirm configuring the policy fixes the issue then we 
close this JIRA :-) ?


> WebClient POST to a resource that returns 401 returns a blank InputStream 
> when there's supposed to be text
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3304
>                 URL: https://issues.apache.org/jira/browse/CXF-3304
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>         Environment: JDK 1.6
>            Reporter: Jason Downey
>            Priority: Minor
>             Fix For: 2.3.3
>
>         Attachments: cxf_jax_rs_post_401_bug.zip, 
> cxf_jax_rs_post_401_bug_httpurlconnection.zip
>
>
> I have two methods that return the same error message upon POST. The only 
> difference is that one returns a 404 response status, the other returns a 401 
> response status.
> POSTing to the resource that returns 404 returns an InputStream containing 
> the error message when you call Response.getEntity(). However, POSTing to the 
> resource that returns 401 returns a blank InputStream when you call 
> Response.getEntity().
> This problem was not reproducible with GET.
> Test case code attached. Launch the server using JettyServer. Then run the 
> WebClient test in WebClientTest.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to