diff --git a/src/Microsoft.Diagnostics.EventFlow.Outputs.Oms/OmsOutput.cs b/src/Microsoft.Diagnostics.EventFlow.Outputs.Oms/OmsOutput.cs index e5fe7463..51eb4e22 100644 --- a/src/Microsoft.Diagnostics.EventFlow.Outputs.Oms/OmsOutput.cs +++ b/src/Microsoft.Diagnostics.EventFlow.Outputs.Oms/OmsOutput.cs @@ -116,7 +116,7 @@ public async Task SendEventsAsync(IReadOnlyCollection events, long tr string dateString = DateTime.UtcNow.ToString("r"); HttpContent content = new StringContent(jsonData, Encoding.UTF8, JsonContentId); - string signature = this.BuildSignature(content.Headers.ContentLength, dateString); + string signature = this.BuildSignature(content.Headers.ContentLength.Value, dateString); content.Headers.ContentType = new MediaTypeHeaderValue(JsonContentId); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, OmsDataUploadUrl); @@ -153,7 +153,7 @@ public async Task SendEventsAsync(IReadOnlyCollection events, long tr } } - private string BuildSignature(long? contentLength, string dateString) + private string BuildSignature(long contentLength, string dateString) { string dateHeader = $"{MsDateHeaderName}:{dateString}"; string signatureInput = $"POST\n{contentLength}\n{JsonContentId}\n{dateHeader}\n{OmsDataUploadResource}";