Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -159,14 +159,9 @@ await Results.Problem(
var memory = writer.GetMemory(chunkSize);
read = await body.ReadAsync(memory, cancellationToken).ConfigureAwait(false);
writer.Advance(read);
} while (read != 0);

// if (_maxRequestSize < writer.Length)
// {
// throw DefaultHttpRequestParser_MaxRequestSizeExceeded();
// }
} while (read == chunkSize);

if (read == 0)
if (writer.Length == 0)
{
throw new BadRequestException("Expected to have a body");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public async ValueTask<GraphQLRequest> ParsePersistedOperationRequestAsync(
{
const int chunkSize = 256;
using var writer = new PooledArrayWriter();
var read = 0;
int read;

do
{
Expand All @@ -72,7 +72,7 @@ public async ValueTask<GraphQLRequest> ParsePersistedOperationRequestAsync(
{
throw DefaultHttpRequestParser_MaxRequestSizeExceeded();
}
} while (read == chunkSize);
} while (read != 0);
Comment thread
tobias-tengler marked this conversation as resolved.

if (writer.Length == 0)
{
Expand Down Expand Up @@ -309,7 +309,7 @@ private async ValueTask<IReadOnlyList<GraphQLRequest>> ReadAsync(
{
throw DefaultHttpRequestParser_MaxRequestSizeExceeded();
}
} while (read == chunkSize);
} while (read != 0);

if (writer.Length == 0)
{
Expand Down
Loading