You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Frédéric RIVIERE (JIRA)" <ji...@apache.org> on 2013/02/01 17:12:12 UTC

[jira] [Commented] (IVY-1400) NullPointerException - problem while listing resources

    [ https://issues.apache.org/jira/browse/IVY-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13568838#comment-13568838 ] 

Frédéric RIVIERE commented on IVY-1400:
---------------------------------------

I would be happy to give a try if you send me a link to a build snapshot.
                
> NullPointerException - problem while listing resources
> ------------------------------------------------------
>
>                 Key: IVY-1400
>                 URL: https://issues.apache.org/jira/browse/IVY-1400
>             Project: Ivy
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Frédéric RIVIERE
>            Assignee: Maarten Coene
>            Priority: Minor
>             Fix For: 2.4.0
>
>
> After debugging, the problem appears when using org.apache.ivy.util.url.HttpClientHandler (connecting jakarta commons http client). 
> A check is missing in getURLInfo() when web server does not return content-type in HTTP header. Line 156, method.getResponseHeader("content-type") returns null so NPE occurs when calling getValue().
> Works fine with BasicURLHandler.
> Should be something like:
> public URLInfo getURLInfo(URL url, int timeout) {
>        ...
> if (checkStatusCode(url, method)) {
>                 HttpResponseHeader h = method.getResponseHeader("content-type");
>                 String contentType = h == null ? null : h.getValue();
>                 String bodyCharset = BasicURLHandler.getCharSetFromContentType(contentType);
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira