Description
We've been using the lib for a long time. In our .Net 8 upgrade testing we started seeing the following:
System.Net.Http.HttpRequestException: Unable to write content to request stream; content would exceed Content-Length.
at Lib.Net.Http.EncryptedContentEncoding.Aes128GcmEncoding.EncryptContentAsync(Stream source, Stream destination, Int32 recordSize, Byte[] contentEncryptionKeyInfoParameterHash, Byte[] nonceInfoParameterHash)
at Lib.Net.Http.EncryptedContentEncoding.Aes128GcmEncoding.EncodeAsync(Stream source, Stream destination, Byte[] salt, Byte[] key, Byte[] keyId, Int32 recordSize)
at Lib.Net.Http.EncryptedContentEncoding.Aes128GcmEncodedContent.SerializeToStreamAsync(Stream stream, TransportContext context)
at System.Net.Http.HttpContent.g__WaitAsync|56_0(ValueTask copyTask)
at System.Net.Http.HttpConnection.SendRequestContentAsync(HttpRequestMessage request, HttpContentWriteStream stream, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.g__Core|5_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.g__Core|5_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Lib.Net.Http.WebPush.PushServiceClient.RequestPushMessageDeliveryAsync(PushSubscription subscription, PushMessage message, VapidAuthentication authentication, VapidAuthenticationScheme authenticationScheme, CancellationToken cancellationToken) in /_/src/Lib.Net.Http.WebPush/PushServiceClient.cs:line 189
Any thoughts on what Content is blowing past the Content-Length. We see this issue with both Microsoft and Google's push notification services.