You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ka-Lok Fung (JIRA)" <ji...@apache.org> on 2011/05/15 07:42:47 UTC

[jira] [Updated] (CXF-3518) WebClient doesn't handle responses containing a quoted-string in a header correctly

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

Ka-Lok Fung updated CXF-3518:
-----------------------------

    Attachment: trunk.wc_quote_minimal.diff

Here's my first attempt at a patch for this issue against trunk.

I'm more than willing to make further changes if anyone has any feedback.

Three specific comments about this patch from my side:
* To leverage the work done in CXF-2462, instead of rolling our own header parsing code in {{WebClient}}, {{HttpHeadersImpl}} is used to do the header parsing.
* This patch could be made more efficient by adding a function to {{HttpHeadersImpl}} to return a {{Map<String, List<String>>}} (see comment in patch). If you don't object to the function addition, I can update the patch with this change.
* I was also looking into adding a unit test but it seems there's no easy way for me to do so (because the header parsing done in {{WebClient}} is only done after a physical connection to a server). If anyone has any feedback on how to add a unit test for this, I'll greatly appreciate it.

> WebClient doesn't handle responses containing a quoted-string in a header correctly
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-3518
>                 URL: https://issues.apache.org/jira/browse/CXF-3518
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.4, 2.3.4
>         Environment: JDK 1.6
>            Reporter: Ka-Lok Fung
>            Priority: Minor
>             Fix For: 2.4.1, 2.3.5
>
>         Attachments: trunk.wc_quote_minimal.diff
>
>
> Similar to CXF-2462, if a request returns a response header that looks like the following:
> bq. {{q: "stuff with commas, and spaces"}}
> WebClient's response.getMetadata() returns 2 values:
> {quote}
> # "stuff with commas
> # and spaces"
> {quote}
> while the correct response should be:
> {quote}
> # stuff with commas, and spaces
> {quote}
> Here's the WebClient code which reproduces the issue (as long as the server response contains a header that returns the header value above):
> {code:Java}
> Response r = WebClient.create(new URI("http://localhost:8080")).path("key/quoted").get();
> List<Object> l = r.getMetadata().get("q");
> {code}

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