Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6660405

HttpURLConnection returns the wrong InputStream

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 7
    • 7
    • core-libs
    • b25
    • generic
    • generic
    • Verified

        When a CacheHandler is provided and the URL is found in the cache after a redirect, HttpURLConnection will return the wrong InputStream, i.e. the one from the redirect instead of the one from the Cache. Which will trigger an IOException since the InputStream from the redirect has been closed.
        This is triggered on the second call to URLConnection.getInputStream().
        One other way this happens is when checking headers first, like getResponseCode() then calling getInputStream().

              jccollet Jean-Christophe Collet (Inactive)
              jccollet Jean-Christophe Collet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: