-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove some http_response_code()
/exit()
/die()
usages
#18068
base: main
Are you sure you want to change the base?
Remove some http_response_code()
/exit()
/die()
usages
#18068
Conversation
67b63ee
to
f9fb916
Compare
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.
As discussed on our internal chat, there are some things to fix
f9fb916
to
3f01a56
Compare
'login_url' => $login_url, | ||
] | ||
) | ||
); |
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.
Responses miss the HTTP code from the Exception objects
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.
This page just displays a message indicating why authentication fails and a link to the login form. We could return a 400 error, but a 200 seems OK too. The authentication error could be related to many possible issues (unavailability of a remote system, bad credentials, ...) and would not always correspond to a bad request.
Anyway, it does not change much for the end user.
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.
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.
I am not sure 400 matches the different cases, but it is probably the more generic 4xx code that could be used.
Checklist before requesting a review
Description
Follows #18046 .
Usage of the
http_response_code()
method is not compatible with manySymfony
features (as explained in #18014) and usage of theexit()
/die()
methods prevents someSymfony
features to be used (e.g. kernel events listeners).I replace some usages of these methods to make the corresponding code fully compatible with the
Symfony
framework.