Skip to content

Commit 7bf707e

Browse files
authored
fix: post hook threw exception on JsonResponse (#287)
If a controller returns an Illuminate\Http\JsonResponse and you have the OpenTelemetry traceresponse or server-timing propagator installed, the Illuminate\Foundation\Http\Kernel::handle() post hook throws an exception due to the ResponsePropagationSetter Illuminate\Http\Response assertion. Changing the Response assertion to the Symfony parent class fixes this.
1 parent 2e315cb commit 7bf707e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Instrumentation/Laravel/src/Propagators/ResponsePropagationSetter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace OpenTelemetry\Contrib\Instrumentation\Laravel\Propagators;
66

77
use function assert;
8-
use Illuminate\Http\Response;
98
use OpenTelemetry\Context\Propagation\PropagationSetterInterface;
9+
use Symfony\Component\HttpFoundation\Response;
1010

1111
/**
1212
* @internal

0 commit comments

Comments
 (0)