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

HttpURLConnection returns the wrong InputStream

    XMLWordPrintable

Details

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

    Backports

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: