diff --git a/extensions/Worker.Extensions.Http/src/DefaultFromBodyConversionFeature.cs b/extensions/Worker.Extensions.Http/src/DefaultFromBodyConversionFeature.cs index 3708fb68..95bc2b19 100644 --- a/extensions/Worker.Extensions.Http/src/DefaultFromBodyConversionFeature.cs +++ b/extensions/Worker.Extensions.Http/src/DefaultFromBodyConversionFeature.cs @@ -56,11 +56,11 @@ internal class DefaultFromBodyConversionFeature : IFromBodyConversionFeature } else if (targetType == typeof(byte[])) { - result = ReadBytes(requestData, context.CancellationToken); // Why is this using the invocations CancellationToken? + result = ReadBytes(requestData); } else if (targetType == typeof(Memory)) { - Memory bytes = ReadBytes(requestData, context.CancellationToken); // Why is this using the invocations CancellationToken? + Memory bytes = ReadBytes(requestData); result = bytes; } else if (HasJsonContentType(requestData)) @@ -68,7 +68,7 @@ internal class DefaultFromBodyConversionFeature : IFromBodyConversionFeature ObjectSerializer serializer = requestData.FunctionContext.InstanceServices.GetService>()?.Value?.Serializer ?? throw new InvalidOperationException("A serializer is not configured for the worker."); - result = serializer.Deserialize(requestData.Body, targetType, context.CancellationToken); // Why is this using the invocations CancellationToken? + result = serializer.Deserialize(requestData.Body, targetType, CancellationToken.None); } else { @@ -78,7 +78,7 @@ internal class DefaultFromBodyConversionFeature : IFromBodyConversionFeature return new ValueTask(result); } - private static byte[] ReadBytes(HttpRequestData requestData, CancellationToken cancellationToken) + private static byte[] ReadBytes(HttpRequestData requestData) { var bytes = new byte[requestData.Body.Length]; requestData.Body.Read(bytes, 0, bytes.Length);