Duplicate :
|
|
Relates :
|
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().
|