On Thu, 2010-05-06 at 17:08 +0200, Leo Galambos wrote:
> Hello,
> 
> I cannot decide who is responsible for an exception in the following
> example -- me or http-core? Should I always handle the
> "getEntity()==null" case in interceptors?
> 
> BTW: ResponseGzipUncompress does not check the case as well
> http://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.0.1/contrib/src/main/java/org/apache/http/contrib/compress/ResponseGzipUncompress.java
> 
> Thank you,
> LG
> 

Leo,

HTTP response messages that do not enclose an entity are rare but
perfectly valid. So, one should always check whether HttpEntity is null
or not. 

Protocol interceptors in the contrib package are meant as reference
material only and are sometimes oversimplified for brevity. But you are
absolutely right, ResponseGzipUncompress not checking HTTP entity for
being non null is wrong.

Does this answer your question?

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to