-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SpanLink::fromHeaders() crash with no or invalid propagated tags (#…
…3025) Signed-off-by: Bob Weinand <[email protected]>
- Loading branch information
1 parent
f95ddcc
commit 000f7f6
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/ext/distributed_tracing/distributed_trace_span_link_from_headers_invalid_tags.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--TEST-- | ||
Setting custom distributed header information with invalid propagated tags | ||
--ENV-- | ||
HTTP_X_DATADOG_TRACE_ID=42 | ||
HTTP_X_DATADOG_PARENT_ID=10 | ||
HTTP_X_DATADOG_TAGS=_dd.p.custom_tag?! | ||
--FILE-- | ||
<?php | ||
|
||
print_r(DDTrace\SpanLink::fromHeaders([ | ||
"traceparent" => "00-0000000000000000000000000000002a-0000000000000001-01", | ||
"tracestate" => "dd=foo:bar=baz", | ||
])); | ||
|
||
?> | ||
--EXPECTF-- | ||
DDTrace\SpanLink Object | ||
( | ||
[traceId] => 0000000000000000000000000000002a | ||
[spanId] => 0000000000000001 | ||
[traceState] => dd=foo:bar=baz | ||
[attributes] => Array | ||
( | ||
[_dd.parent_id] => 0000000000000000 | ||
) | ||
|
||
) |