1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-19 20:32:57 +00:00

Improved ETag parsing

This commit is contained in:
David A. Velasco
2015-09-28 10:49:45 +02:00
parent 092c790030
commit f61b466124
3 changed files with 49 additions and 11 deletions
@@ -150,16 +150,9 @@ public class DownloadRemoteFileOperation extends RemoteOperation {
} else {
Log_OC.e(TAG, "Could not read modification time from response downloading " + mRemotePath);
}
Header eTag = mGet.getResponseHeader("ETag");
if (eTag == null) {
eTag = mGet.getResponseHeader("etag");
}
if (eTag != null) {
mEtag = eTag.getValue();
if (mEtag.charAt(0) == '"' && mEtag.charAt(mEtag.length() - 1) == '"') {
mEtag = mEtag.substring(1, mEtag.length() - 1);
}
} else {
mEtag = WebdavUtils.getEtagFromResponse(mGet);
if (mEtag.length() == 0) {
Log_OC.e(TAG, "Could not read eTag from response downloading " + mRemotePath);
}