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

Need to review plugin cached JarURLConnection.getURL during redirect

XMLWordPrintable

    • b08
    • generic
    • generic
    • Verified

        URLConnection should behave not identically but largely compatibly regardless of whether the resource is cached or not. The caching should largely be invisible to the callers of URLConnection. Yet while debugging redirect case with plugin and webstart, I can see that there is difference in returned value of URLConnection.getURL() b/w cached and non-cached.

        The reason in the code. HttpURLConnection.getInputStream(), connect() was called which would eventually access CacheResponse.get() and set cachedInputStream. Because of this, followRedirect() is not called and the url field would not get the final url value. The same with CachedJarURLConnection implementation.

        Note: it is important any change to the above implementations of getURL() should not break client (applet/application) code.

              nam Nam Nguyen (Inactive)
              nam Nam Nguyen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: