Skip to content

Commit

Permalink
fix: post hook threw exception on JsonResponse
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
taisph committed Aug 20, 2024
1 parent c6c4b3c commit 4e053c7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace OpenTelemetry\Contrib\Instrumentation\Laravel\Propagators;

use function assert;
use Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\Response;
use OpenTelemetry\Context\Propagation\PropagationSetterInterface;

/**
Expand Down

0 comments on commit 4e053c7

Please sign in to comment.