Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1400

NullPointerException - problem while listing resources

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0-RC1
    • None
    • None

    Description

      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);
      ...

      Attachments

        Issue Links

          Activity

            People

              maartenc Maarten Coene
              friviere Frédéric RIVIERE
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: