diff --git a/app/src/main/java/com/nextcloud/android/sso/DeleteMethodWithBody.java b/app/src/main/java/com/nextcloud/android/sso/DeleteMethodWithBody.java new file mode 100644 index 0000000000000000000000000000000000000000..069ab76cde794649027e9f004686a16ead730533 --- /dev/null +++ b/app/src/main/java/com/nextcloud/android/sso/DeleteMethodWithBody.java @@ -0,0 +1,35 @@ +/* + * Copyright MURENA SAS 2026 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.nextcloud.android.sso; + +import org.apache.commons.httpclient.methods.EntityEnclosingMethod; + +public class DeleteMethodWithBody extends EntityEnclosingMethod { + + public DeleteMethodWithBody() { + super(); + } + + public DeleteMethodWithBody(String uri) { + super(uri); + } + + @Override + public String getName() { + return "DELETE"; + } +} diff --git a/app/src/main/java/com/nextcloud/android/sso/InputStreamBinder.java b/app/src/main/java/com/nextcloud/android/sso/InputStreamBinder.java index 2c8bad6e96eb493c53f2ff1addf41605396812ef..025dc7f9b5ee77c805cc224038c2114324b458e1 100644 --- a/app/src/main/java/com/nextcloud/android/sso/InputStreamBinder.java +++ b/app/src/main/java/com/nextcloud/android/sso/InputStreamBinder.java @@ -299,6 +299,21 @@ public class InputStreamBinder extends IInputStreamService.Stub { } break; + case "DELETE_PASSWORD": + method = new DeleteMethodWithBody(requestUrl); + if (requestBodyInputStream != null) { + RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream); + ((DeleteMethodWithBody) method).setRequestEntity(requestEntity); + method = new DeleteMethodWithBody(requestUrl); + } else if (request.getRequestBody() != null) { + StringRequestEntity requestEntity = new StringRequestEntity( + request.getRequestBody(), + CONTENT_TYPE_APPLICATION_JSON, + CHARSET_UTF8); + ((DeleteMethodWithBody) method).setRequestEntity(requestEntity); + } + break; + case "DELETE": method = new DeleteMethod(requestUrl); break;