Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
fix: prevent setting unsupported messageid header
Browse files Browse the repository at this point in the history
  • Loading branch information
cruikshj committed Jul 28, 2016
1 parent bbafd74 commit 11aefe9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions SMLogging/RequestLoggingMessageInspector.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.Sockets;
Expand Down Expand Up @@ -178,9 +180,19 @@ public object BeforeSendRequest(ref Message request, IClientChannel channel)

if (request != null)
{
if (AddMessageIdRequestHeader && request.Headers.MessageId == null)
if (AddMessageIdRequestHeader && request.Headers.MessageId == null && request.Version.Addressing != AddressingVersion.None)
{
request.Headers.MessageId = new UniqueId(Guid.NewGuid());
try
{
request.Headers.MessageId = new UniqueId(Guid.NewGuid());
}
catch
{
if (Debugger.IsAttached)
{
throw;
}
}
}

data.MessageId = GetMessageId(request.Headers.MessageId);
Expand Down

0 comments on commit 11aefe9

Please sign in to comment.