Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/JsonRpc/Receiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,25 @@ protected virtual Renor GetRenor(JToken @object)

var properties = request.Properties().ToLookup(z => z.Name, StringComparer.OrdinalIgnoreCase);

var traceStateProperty = properties["tracestate"].FirstOrDefault();
var traceState = traceStateProperty?.Value.ToString();
var traceParentProperty = properties["traceparent"].FirstOrDefault();
var traceParent = traceParentProperty?.Value.ToString();

// id == request
// !id == notification
if (!hasRequestId)
{
return new Notification(method!, @params) {
TraceState = properties["tracestate"].FirstOrDefault()?.Value<string>(),
TraceParent = properties["traceparent"].FirstOrDefault()?.Value<string>()
TraceState = traceState,
TraceParent = traceParent,
};
}
else
{
return new Request(requestId!, method!, @params) {
TraceState = properties["tracestate"].FirstOrDefault()?.Value<string>(),
TraceParent = properties["traceparent"].FirstOrDefault()?.Value<string>()
TraceState = traceState,
TraceParent = traceParent,
};
}
}
Expand Down