1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fixed existence check on files when automatic redirections are explicitly disabled (SAML SSO)

This commit is contained in:
David A. Velasco 2015-07-02 14:02:31 +02:00
parent f5fbca24be
commit 02c24c8a3b

View File

@ -83,9 +83,11 @@ public class ExistenceCheckRemoteOperation extends RemoteOperation {
try { try {
head = new HeadMethod(client.getWebdavUri() + WebdavUtils.encodePath(mPath)); head = new HeadMethod(client.getWebdavUri() + WebdavUtils.encodePath(mPath));
client.setFollowRedirects(false); client.setFollowRedirects(false);
client.executeMethod(head, TIMEOUT, TIMEOUT); int status = client.executeMethod(head, TIMEOUT, TIMEOUT);
mRedirectionPath = client.followRedirection(head); if (previousFollowRedirects) {
int status = mRedirectionPath.getLastStatus(); mRedirectionPath = client.followRedirection(head);
status = mRedirectionPath.getLastStatus();
}
client.exhaustResponse(head.getResponseBodyAsStream()); client.exhaustResponse(head.getResponseBodyAsStream());
boolean success = (status == HttpStatus.SC_OK && !mSuccessIfAbsent) || boolean success = (status == HttpStatus.SC_OK && !mSuccessIfAbsent) ||
(status == HttpStatus.SC_NOT_FOUND && mSuccessIfAbsent); (status == HttpStatus.SC_NOT_FOUND && mSuccessIfAbsent);