aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-07 23:52:19 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-07 23:52:19 +0200
commitbe20e4b9190a247e3752664f397cc79a8966094d (patch)
tree2bce433f538ad5a9416c424386379b839d4667a4
parent102f1abea814aaced85d1ba4be949a61d1981c1e (diff)
disable caches in HttpUrlConnections
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java2
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpUploadConnection.java1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
index d2e6135a0..dee5bcb05 100644
--- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
@@ -235,6 +235,7 @@ public class HttpDownloadConnection implements Transferable {
connection = (HttpURLConnection) mUrl.openConnection();
}
connection.setRequestMethod("HEAD");
+ connection.setUseCaches(false);
Log.d(Config.LOGTAG, "url: " + connection.getURL().toString());
Log.d(Config.LOGTAG, "connection: " + connection.toString());
connection.setRequestProperty("User-Agent", mXmppConnectionService.getIqGenerator().getIdentityName());
@@ -306,6 +307,7 @@ public class HttpDownloadConnection implements Transferable {
if (connection instanceof HttpsURLConnection) {
mHttpConnectionManager.setupTrustManager((HttpsURLConnection) connection, interactive);
}
+ connection.setUseCaches(false);
connection.setRequestProperty("User-Agent", mXmppConnectionService.getIqGenerator().getIdentityName());
final boolean tryResume = file.exists() && file.getKey() == null && file.getSize() > 0;
long resumeSize = 0;
diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
index 7dd74fb15..7bdfd4db8 100644
--- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java
@@ -186,6 +186,7 @@ public class HttpUploadConnection implements Transferable {
if (connection instanceof HttpsURLConnection) {
mHttpConnectionManager.setupTrustManager((HttpsURLConnection) connection, true);
}
+ connection.setUseCaches(false);
connection.setRequestMethod("PUT");
connection.setFixedLengthStreamingMode(expectedFileSize);
connection.setRequestProperty("Content-Type", mime == null ? "application/octet-stream" : mime);