-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: post hook threw exception on JsonResponse #287
fix: post hook threw exception on JsonResponse #287
Conversation
Thanks for opening your first pull request! If you haven't yet signed our Contributor License Agreement (CLA), then please do so that we can accept your contribution. A link should appear shortly in this PR if you have not already signed one. |
|
4e053c7
to
f4496b3
Compare
Thanks, @taisph it looks like pretty simple. If you're able, it would be good if you could also supply a test. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #287 +/- ##
============================================
+ Coverage 82.50% 82.74% +0.24%
+ Complexity 1083 495 -588
============================================
Files 105 48 -57
Lines 4578 2243 -2335
============================================
- Hits 3777 1856 -1921
+ Misses 801 387 -414 Flags with carried forward coverage won't be shown. Click here to find out more. see 57 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
I can't seem to find a way to trigger a JsonResponse object through Http::fake. Btw. I suspect a RedirectResponse will cause the same issue, but should be fixed by this change as well. |
No problem. Can you fix the build complaints (ordered imports) please? |
f4496b3
to
118e835
Compare
Should be fixed now. |
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.
118e835
to
e49b661
Compare
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.