Skip to content

Commit

Permalink
Merge pull request #54 from vyuldashev/master
Browse files Browse the repository at this point in the history
Headers should not be case sensitive.
  • Loading branch information
jukylin committed Aug 8, 2019
2 parents ba8cabf + 17ae462 commit 5598896
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Jaeger/Propagator/JaegerPropagator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ public function inject(SpanContext $spanContext, $format, &$carrier){
*/
public function extract($format, $carrier){
$spanContext = new SpanContext(0, 0, 0, null, 0);

$carrier = array_change_key_case($carrier, CASE_LOWER);

foreach ($carrier as $k => $v){

$k = strtolower($k);
$v = urldecode($v);
if($k == Constants\Tracer_State_Header_Name){
list($traceId, $spanId, $parentId,$flags) = explode(':', $carrier[strtoupper($k)]);
list($traceId, $spanId, $parentId,$flags) = explode(':', $carrier[$k]);

$spanContext->spanId = $spanContext->hexToSignedInt($spanId);
$spanContext->parentId = $spanContext->hexToSignedInt($parentId);
Expand Down Expand Up @@ -79,4 +81,4 @@ public function extract($format, $carrier){
return $spanContext;
}

}
}

0 comments on commit 5598896

Please sign in to comment.