Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: #5533 - Enabled reading request body for HTTP POST requests. #13853

Merged
merged 6 commits into from
Feb 2, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Text;
using System.IO;
using System.Collections.Generic;
using System.Text.Json;
using System.Threading.Tasks;
Expand Down Expand Up @@ -43,7 +45,13 @@
return NotFound();
}

var queryParameters = parameters != null ?
if (Request.Method == "POST" && string.IsNullOrEmpty(parameters))
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
{
using var reader = new StreamReader(Request.Body, Encoding.UTF8);
parameters = await reader.ReadToEndAsync();
}

var queryParameters = !String.IsNullOrEmpty(parameters) ?

Check failure on line 54 in src/OrchardCore.Modules/OrchardCore.Queries/Controllers/ApiController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name 'String' does not exist in the current context

Check failure on line 54 in src/OrchardCore.Modules/OrchardCore.Queries/Controllers/ApiController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name 'String' does not exist in the current context

Check failure on line 54 in src/OrchardCore.Modules/OrchardCore.Queries/Controllers/ApiController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name 'String' does not exist in the current context

Check failure on line 54 in src/OrchardCore.Modules/OrchardCore.Queries/Controllers/ApiController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name 'String' does not exist in the current context
JConvert.DeserializeObject<Dictionary<string, object>>(parameters)
: [];

Expand Down
Loading