Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 3abda591 authored by tobiasKaminsky's avatar tobiasKaminsky
Browse files

token in header

parent cb38723f
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;

import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.DeleteMethod;


@@ -65,18 +64,12 @@ public class UnlockFileOperation extends RemoteOperation {
            deleteMethod = new DeleteMethod(client.getBaseUri() + LOCK_FILE_URL + localId);
            deleteMethod.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
            deleteMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded");

            NameValuePair[] deleteParams = new NameValuePair[1];
            deleteParams[0] = new NameValuePair("token", token);
            deleteMethod.setQueryString(deleteParams);
            deleteMethod.addRequestHeader("token", token);

            int status = client.executeMethod(deleteMethod, SYNC_READ_TIMEOUT, SYNC_CONNECTION_TIMEOUT);

            if (status == HttpStatus.SC_OK) {
                result = new RemoteOperationResult(true, deleteMethod);
            } else {
                result = new RemoteOperationResult(false, deleteMethod);
            }
            result = new RemoteOperationResult(status == HttpStatus.SC_OK, deleteMethod);
            
            client.exhaustResponse(deleteMethod.getResponseBodyAsStream());
        } catch (Exception e) {
            result = new RemoteOperationResult(e);