[ 
https://issues.apache.org/jira/browse/CXF-8822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Magnus Holm updated CXF-8822:
-----------------------------
    Description: 
{{AsyncHTTPConduit.setupConnection(Message message, Address address, 
HTTPClientPolicy csPolicy)}} performs some URI-cleanup which results in 
query-parameters being removed when the path-part of the URI is empty. 


{code:java}
    @Test
    public void testEmptyPathWithQueryParams() throws IOException {
        String address = "http://localhost?param1=value1&param2=value2";;
        Greeter greeter = new SOAPService().getSoapPort();
        setAddress(greeter, address);
        HTTPConduit c = (HTTPConduit)((ClientProxy) 
Proxy.getInvocationHandler(greeter)).getClient().getConduit();
        MessageImpl message = new MessageImpl();
        message.put(USE_ASYNC, true);
        ExchangeImpl exchange = new ExchangeImpl();
        message.setExchange(exchange);
        c.prepare(message);
        CXFHttpRequest e = message.get(CXFHttpRequest.class);
        assertEquals(address, e.getUri().toString()); // query-parameters gone
    }
{code}


  was:
{{AsyncHTTPConduit.setupConnection(Message message, Address address, 
HTTPClientPolicy csPolicy)}} performs some URI-cleanup which results in 
query-parameters being removed when the path-part of the URI is empty. 


{code:java}
@Test
    public void testEmptyPathWithQueryParams() throws IOException {
        String address = "http://localhost?param1=value1&param2=value2";;
        Greeter greeter = new SOAPService().getSoapPort();
        setAddress(greeter, address);
        HTTPConduit c = (HTTPConduit)((ClientProxy) 
Proxy.getInvocationHandler(greeter)).getClient().getConduit();
        MessageImpl message = new MessageImpl();
        message.put(USE_ASYNC, true);
        ExchangeImpl exchange = new ExchangeImpl();
        message.setExchange(exchange);
        c.prepare(message);
        CXFHttpRequest e = message.get(CXFHttpRequest.class);
        assertEquals(address, e.getUri().toString()); // query-parameters gone
    }
{code}



> AsyncHTTPConduit removes query-parameters when path is empty
> ------------------------------------------------------------
>
>                 Key: CXF-8822
>                 URL: https://issues.apache.org/jira/browse/CXF-8822
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 3.5.5
>            Reporter: Magnus Holm
>            Priority: Major
>
> {{AsyncHTTPConduit.setupConnection(Message message, Address address, 
> HTTPClientPolicy csPolicy)}} performs some URI-cleanup which results in 
> query-parameters being removed when the path-part of the URI is empty. 
> {code:java}
>     @Test
>     public void testEmptyPathWithQueryParams() throws IOException {
>         String address = "http://localhost?param1=value1&param2=value2";;
>         Greeter greeter = new SOAPService().getSoapPort();
>         setAddress(greeter, address);
>         HTTPConduit c = (HTTPConduit)((ClientProxy) 
> Proxy.getInvocationHandler(greeter)).getClient().getConduit();
>         MessageImpl message = new MessageImpl();
>         message.put(USE_ASYNC, true);
>         ExchangeImpl exchange = new ExchangeImpl();
>         message.setExchange(exchange);
>         c.prepare(message);
>         CXFHttpRequest e = message.get(CXFHttpRequest.class);
>         assertEquals(address, e.getUri().toString()); // query-parameters gone
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to