- Timestamp:
- 2015-12-31T10:37:05+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r9212 r9228 311 311 } 312 312 313 HttpURLConnection urlConn = getURLConnection(getUrl() );313 HttpURLConnection urlConn = getURLConnection(getUrl(), true); 314 314 315 315 if (isObjectLoadable() && … … 326 326 for (int i = 0; i < 5; i++) { 327 327 if (urlConn.getResponseCode() == 302) { 328 urlConn = getURLConnection(new URL(urlConn.getHeaderField("Location")) );328 urlConn = getURLConnection(new URL(urlConn.getHeaderField("Location")), true); 329 329 } else { 330 330 break; … … 470 470 } 471 471 472 private HttpURLConnection getURLConnection(URL url ) throws IOException {472 private HttpURLConnection getURLConnection(URL url, boolean noCache) throws IOException { 473 473 HttpURLConnection urlConn = (HttpURLConnection) url.openConnection(); 474 474 urlConn.setRequestProperty("Accept", "text/html, image/png, image/jpeg, image/gif, */*"); … … 481 481 } 482 482 483 if (force ) {483 if (force || noCache) { 484 484 urlConn.setUseCaches(false); 485 485 } … … 488 488 489 489 private boolean isCacheValidUsingHead() throws IOException { 490 HttpURLConnection urlConn = getURLConnection(getUrl() );490 HttpURLConnection urlConn = getURLConnection(getUrl(), false); 491 491 urlConn.setRequestMethod("HEAD"); 492 492 for (int i = 0; i < 5; i++) { 493 493 if (urlConn.getResponseCode() == 302) { 494 urlConn = getURLConnection(new URL(urlConn.getHeaderField("Location")) );494 urlConn = getURLConnection(new URL(urlConn.getHeaderField("Location")), false); 495 495 } else { 496 496 break;
Note:
See TracChangeset
for help on using the changeset viewer.