This seems to be an oversight in HttpURLConnection where the system-wide ResponseCache handler is used to store responses even if getUsesCaches returns false.

I guess this was never really noticed before since the cached response will not be used if getUsesCaches returns false for future requests.

The solution is to check if (cacheHandler != null && getUsesCaches()), similar to what is done during connect/plainConnect().

http://cr.openjdk.java.net/~chegar/7133367/webrev.00/webrev/

Thanks,
-Chris.

Reply via email to