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

Fixed Jobs SDK bugs #1456

Merged
merged 8 commits into from
Feb 11, 2025
5 changes: 2 additions & 3 deletions src/Dapr.Jobs/Extensions/EndpointRouteBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ public static IEndpointRouteBuilder MapDaprScheduledJobHandler(this IEndpointRou
ReadOnlyMemory<byte> payload = new();
if (context.Request.ContentLength is > 0)
{
using var memoryStream = new MemoryStream();
await context.Request.Body.CopyToAsync(memoryStream, cancellationToken);
payload = memoryStream.ToArray();
using var streamContent = new StreamContent(context.Request.Body);
payload = await streamContent.ReadAsByteArrayAsync(cancellationToken);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should work just as well, though I was specifically thinking of (I think) context.Request.Body.ReadAsByteArrayAsync().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, whoops. For some reason, Intellisense isn't showing that as an option - I'll have to look into why.

}

var parameters = new Dictionary<Type, object>
Expand Down
Loading