Skip to content

Commit

Permalink
Merge pull request nextcloud#13452 from nextcloud/backport/13232/stab…
Browse files Browse the repository at this point in the history
…le-3.29

[stable-3.29] Set content length to -1 for InputStream request bodies from the nextcloud/Android-SingleSignOn library
  • Loading branch information
AndyScherzinger authored Aug 26, 2024
2 parents f8050e5 + 487b77f commit 738f0dd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private HttpMethodBase buildMethod(NextcloudRequest request, Uri baseUri, InputS
case "POST":
method = new PostMethod(requestUrl);
if (requestBodyInputStream != null) {
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream);
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream, -1);
((PostMethod) method).setRequestEntity(requestEntity);
} else if (request.getRequestBody() != null) {
StringRequestEntity requestEntity = new StringRequestEntity(
Expand All @@ -251,7 +251,7 @@ private HttpMethodBase buildMethod(NextcloudRequest request, Uri baseUri, InputS
case "PATCH":
method = new PatchMethod(requestUrl);
if (requestBodyInputStream != null) {
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream);
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream, -1);
((PatchMethod) method).setRequestEntity(requestEntity);
} else if (request.getRequestBody() != null) {
StringRequestEntity requestEntity = new StringRequestEntity(
Expand All @@ -265,7 +265,7 @@ private HttpMethodBase buildMethod(NextcloudRequest request, Uri baseUri, InputS
case "PUT":
method = new PutMethod(requestUrl);
if (requestBodyInputStream != null) {
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream);
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream, -1);
((PutMethod) method).setRequestEntity(requestEntity);
} else if (request.getRequestBody() != null) {
StringRequestEntity requestEntity = new StringRequestEntity(
Expand Down

0 comments on commit 738f0dd

Please sign in to comment.