-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Improve dump for SPA apps like. #58268
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
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
you can also leverage https://symfony.com/doc/current/components/var_dumper.html#the-dump-server |
header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN'] ?? '*'); | ||
header('Access-Control-Allow-Methods: *'); | ||
header('Access-Control-Allow-Headers: *'); | ||
header('Access-Control-Allow-Credentials: true'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sending headers while containing the execution of the code after that function looks like a very bad idea to me (as it will likely break the response sending done later)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dd
does not continue execution, as it dumps and dies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sry, i remove this. i don't think is needed.
update: i always end with ddh and it's working.
header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN'] ?? '*'); | ||
header('Access-Control-Allow-Methods: *'); | ||
header('Access-Control-Allow-Headers: *'); | ||
header('Access-Control-Allow-Credentials: true'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be added directly to dd
instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe? i am not sure, i never have problems with dd, expect SPA/javascript apps.
i don't think adding directly to dd will negative impact any scenario, since is a debug function.
on my local machine i always add this to dd and i don't have any problems.
// CORS for SPA apps like. | ||
header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN'] ?? '*'); | ||
header('Access-Control-Allow-Methods: *'); | ||
header('Access-Control-Allow-Headers: *'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be inside the check for header_sent
as done for the other header ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you right, updated.
@94noni thanks! But i think it easier to read directly from browser. (just my opinion) |
Let's work on #58070 instead. |
A lot of people (including me) use SPA/javascript applications and it would be easier if you could sometimes see the result directly in the browser without having to copy the request to Insomnia or to always manually enter the necessary headers.