cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xu ShiChang Desmond (JIRA)" <>
Subject [jira] [Commented] (CXF-6185) cxf org.apache.cxf.transport.http.policy.impl.ClientPolicyCalculator
Date Tue, 13 Jan 2015 04:21:35 GMT


Xu ShiChang Desmond commented on CXF-6185:

Daniel, the way the Client policies work is that one can choose to 'Not specify' properties
when one does not particularly care about those properties. By choosing not to specify the
allowChunking property in p2, I am in effect saying 'I do not care whether chunking is enabled
or not' - I am not saying that I am insisting that chunking must be allowed.

For example, 
HTTPClientPolicy p1 = new HTTPClientPolicy();
HTTPClientPolicy p2 = new HTTPClientPolicy();
and now, new ClientPolicyCalculator().compatible(p1, p2) returns true because p2 did not specify
any 'accept'.

This bug is affecting allowChunking, and also similarly affecting autoRedirect

> cxf org.apache.cxf.transport.http.policy.impl.ClientPolicyCalculator
> --------------------------------------------------------------------
>                 Key: CXF-6185
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 3.0.2
>            Reporter: Xu ShiChang Desmond
>         Attachments:
> org.apache.cxf.transport.http.policy.impl.ClientPolicyCalculator.compatible(HTTPClientPolicy
p1, HTTPClientPolicy p2)'s intention is to return true unless there is a property someProp
which is specified in both policies and having different values. For the property allowChunking
though, it simply does p1.isAllowChunking() == p2.isAllowChunking().
> However HTTPClientPolicy.isAllowChunking returns a boolean and defaults to 'true' if
> Given two client policies, one where allowChunking is specified to be false, while unspecified
in the other policy is thus not handled correctly as intended, the autoRedirect property also
looks to be suffering the same symptom as allowChunking.
> Simple test case reproduces this problem:
>   HTTPClientPolicy p1 = new HTTPClientPolicy();
>   HTTPClientPolicy p2 = new HTTPClientPolicy();
>   p1.setAllowChunking(false);
>   Assert.assertTrue(new ClientPolicyCalculator().compatible(p1, p2));

This message was sent by Atlassian JIRA

View raw message