File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -100,20 +100,25 @@ protected virtual Renor GetRenor(JToken @object)
100100
101101 var properties = request . Properties ( ) . ToLookup ( z => z . Name , StringComparer . OrdinalIgnoreCase ) ;
102102
103+ var traceStateProperty = properties [ "tracestate" ] . FirstOrDefault ( ) ;
104+ var traceState = traceStateProperty ? . Value . ToString ( ) ;
105+ var traceParentProperty = properties [ "traceparent" ] . FirstOrDefault ( ) ;
106+ var traceParent = traceParentProperty ? . Value . ToString ( ) ;
107+
103108 // id == request
104109 // !id == notification
105110 if ( ! hasRequestId )
106111 {
107112 return new Notification ( method ! , @params ) {
108- TraceState = properties [ "tracestate" ] . FirstOrDefault ( ) ? . Value < string > ( ) ,
109- TraceParent = properties [ "traceparent" ] . FirstOrDefault ( ) ? . Value < string > ( )
113+ TraceState = traceState ,
114+ TraceParent = traceParent ,
110115 } ;
111116 }
112117 else
113118 {
114119 return new Request ( requestId ! , method ! , @params ) {
115- TraceState = properties [ "tracestate" ] . FirstOrDefault ( ) ? . Value < string > ( ) ,
116- TraceParent = properties [ "traceparent" ] . FirstOrDefault ( ) ? . Value < string > ( )
120+ TraceState = traceState ,
121+ TraceParent = traceParent ,
117122 } ;
118123 }
119124 }
You can’t perform that action at this time.
0 commit comments