Browse Source

Disable the JRE HTTP cache, if any

We don't want to use the JRE cache when fetching content.

Change-Id: Id76f3e618967c98ed4fbc47a1a2a9e77acbe41ab
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.7
Shawn O. Pearce 15 years ago
parent
commit
e905d93f9f
  1. 1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

1
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

@ -373,6 +373,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
final HttpURLConnection httpOpen(final URL u) throws IOException { final HttpURLConnection httpOpen(final URL u) throws IOException {
final Proxy proxy = HttpSupport.proxyFor(proxySelector, u); final Proxy proxy = HttpSupport.proxyFor(proxySelector, u);
HttpURLConnection conn = (HttpURLConnection) u.openConnection(proxy); HttpURLConnection conn = (HttpURLConnection) u.openConnection(proxy);
conn.setUseCaches(false);
conn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP); conn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP);
conn.setRequestProperty(HDR_PRAGMA, "no-cache");//$NON-NLS-1$ conn.setRequestProperty(HDR_PRAGMA, "no-cache");//$NON-NLS-1$
conn.setRequestProperty(HDR_USER_AGENT, userAgent); conn.setRequestProperty(HDR_USER_AGENT, userAgent);

Loading…
Cancel
Save