You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Steve Loughran (JIRA)" <ji...@apache.org> on 2010/09/16 12:19:34 UTC

[jira] Updated: (HTTPCORE-233) EntityUtils.toString() turns missing content into ""

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

Steve Loughran updated HTTPCORE-233:
------------------------------------

    Priority: Minor  (was: Major)

> EntityUtils.toString() turns missing content into ""
> ----------------------------------------------------
>
>                 Key: HTTPCORE-233
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-233
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>    Affects Versions: 4.0.1
>         Environment: Ubuntu 10.04 x64 java 6u21
>            Reporter: Steve Loughran
>            Priority: Minor
>
> I understand that some people may view this as expected behaviour, but I'm trying to track down why some of my tests are failing with a message body of "" rather than some JSON, and it looks to me a bit like {{EntityUtils}} is at fault for hiding the real problem.
> Looking at line 138 of {{EntityUtils}} , the code goes
> {code}
>         InputStream instream = entity.getContent();
>         if (instream == null) {
>             return "";
>         }
> {code}
> that is, null content is turned into an empty string. I'd be happier if null content got returned as null, then I'd be able to distinguish problems. As it is, I'm going to have to copy the method and tweak it. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org