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

HttpURLConnection returns the wrong InputStream

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b25
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      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

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: