Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update docs for setting custom response code in exception handler#6948

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@jameshalsall
Copy link
Contributor

Docs update for the changes applied insymfony/symfony#19822

);
response alone won't work. If you want to overwrite the status code
(which you should not without a good reason), call
``GetResponseForExceptionEvent::setAllowSuccessfulResponse(true)`` and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

should besetAllowCustomResponseCode as the method has been renamed.

@jameshalsalljameshalsallforce-pushed theallow-successful-response-code-docs branch fromc413297 tod825c4aCompareNovember 13, 2016 20:37
@xabbuhxabbuh added this to the3.3 milestoneDec 30, 2016
fabpot added a commit to symfony/symfony that referenced this pull requestMar 1, 2017
…ative (jameshalsall)This PR was merged into the 3.3-dev branch.Discussion----------[HttpKernel] Deprecate X-Status-Code for better alternative| Q | A || --- | --- || Branch? | master || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | yes || Tests pass? | yes || Fixed tickets |#12343 || License | MIT || Doc PR |symfony/symfony-docs#6948 |This marks the X-Status-Code header method of setting a custom response statuscode in exception listeners for a better alternative. There is now a new methodon the `GetResponseForExceptionEvent` that allows successful status codes inthe response sent to the client.The old method of setting the X-Status-Code header will now throw a deprecation warning.Instead, in your exception listener you simply call `GetResponseForExceptionEvent::allowCustomResponseCode()` which will tell the Kernel not to override the status code of the event's response object.Currenty the `X-Status-Code` header will still be removed, so as not to change the existing behaviour, but this is something we can remove in 4.0.TODO:- [x] Replace usage of X-Status-Code in `FormAuthenticationEntryPoint`- [x] Open Silex issue- [x] Rename method on the response- [x] Ensure correct response code is set in `AuthenticationEntryPointInterface` implementations- [x] Ensure the exception listeners are marking `GetResponseForExceptionEvent` as allowing a custom response code- [x] In the Security component we should only use the new method of setting a custom response code if it is available, and fall back to the `X-Status-Code` methodCommits-------cc0ef28 [HttpKernel] Deprecate X-Status-Code for better alternative
symfony-splitter pushed a commit to symfony/http-kernel that referenced this pull requestMar 1, 2017
…ative (jameshalsall)This PR was merged into the 3.3-dev branch.Discussion----------[HttpKernel] Deprecate X-Status-Code for better alternative| Q | A || --- | --- || Branch? | master || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | yes || Tests pass? | yes || Fixed tickets | #12343 || License | MIT || Doc PR |symfony/symfony-docs#6948 |This marks the X-Status-Code header method of setting a custom response statuscode in exception listeners for a better alternative. There is now a new methodon the `GetResponseForExceptionEvent` that allows successful status codes inthe response sent to the client.The old method of setting the X-Status-Code header will now throw a deprecation warning.Instead, in your exception listener you simply call `GetResponseForExceptionEvent::allowCustomResponseCode()` which will tell the Kernel not to override the status code of the event's response object.Currenty the `X-Status-Code` header will still be removed, so as not to change the existing behaviour, but this is something we can remove in 4.0.TODO:- [x] Replace usage of X-Status-Code in `FormAuthenticationEntryPoint`- [x] Open Silex issue- [x] Rename method on the response- [x] Ensure correct response code is set in `AuthenticationEntryPointInterface` implementations- [x] Ensure the exception listeners are marking `GetResponseForExceptionEvent` as allowing a custom response code- [x] In the Security component we should only use the new method of setting a custom response code if it is available, and fall back to the `X-Status-Code` methodCommits-------cc0ef28 [HttpKernel] Deprecate X-Status-Code for better alternative
symfony-splitter pushed a commit to symfony/security that referenced this pull requestMar 1, 2017
…ative (jameshalsall)This PR was merged into the 3.3-dev branch.Discussion----------[HttpKernel] Deprecate X-Status-Code for better alternative| Q | A || --- | --- || Branch? | master || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | yes || Tests pass? | yes || Fixed tickets | #12343 || License | MIT || Doc PR |symfony/symfony-docs#6948 |This marks the X-Status-Code header method of setting a custom response statuscode in exception listeners for a better alternative. There is now a new methodon the `GetResponseForExceptionEvent` that allows successful status codes inthe response sent to the client.The old method of setting the X-Status-Code header will now throw a deprecation warning.Instead, in your exception listener you simply call `GetResponseForExceptionEvent::allowCustomResponseCode()` which will tell the Kernel not to override the status code of the event's response object.Currenty the `X-Status-Code` header will still be removed, so as not to change the existing behaviour, but this is something we can remove in 4.0.TODO:- [x] Replace usage of X-Status-Code in `FormAuthenticationEntryPoint`- [x] Open Silex issue- [x] Rename method on the response- [x] Ensure correct response code is set in `AuthenticationEntryPointInterface` implementations- [x] Ensure the exception listeners are marking `GetResponseForExceptionEvent` as allowing a custom response code- [x] In the Security component we should only use the new method of setting a custom response code if it is available, and fall back to the `X-Status-Code` methodCommits-------cc0ef282cd [HttpKernel] Deprecate X-Status-Code for better alternative
symfony-splitter pushed a commit to symfony/security-http that referenced this pull requestMar 1, 2017
…ative (jameshalsall)This PR was merged into the 3.3-dev branch.Discussion----------[HttpKernel] Deprecate X-Status-Code for better alternative| Q | A || --- | --- || Branch? | master || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | yes || Tests pass? | yes || Fixed tickets | #12343 || License | MIT || Doc PR |symfony/symfony-docs#6948 |This marks the X-Status-Code header method of setting a custom response statuscode in exception listeners for a better alternative. There is now a new methodon the `GetResponseForExceptionEvent` that allows successful status codes inthe response sent to the client.The old method of setting the X-Status-Code header will now throw a deprecation warning.Instead, in your exception listener you simply call `GetResponseForExceptionEvent::allowCustomResponseCode()` which will tell the Kernel not to override the status code of the event's response object.Currenty the `X-Status-Code` header will still be removed, so as not to change the existing behaviour, but this is something we can remove in 4.0.TODO:- [x] Replace usage of X-Status-Code in `FormAuthenticationEntryPoint`- [x] Open Silex issue- [x] Rename method on the response- [x] Ensure correct response code is set in `AuthenticationEntryPointInterface` implementations- [x] Ensure the exception listeners are marking `GetResponseForExceptionEvent` as allowing a custom response code- [x] In the Security component we should only use the new method of setting a custom response code if it is available, and fall back to the `X-Status-Code` methodCommits-------cc0ef282cd [HttpKernel] Deprecate X-Status-Code for better alternative
@xabbuhxabbuh removed the On hold labelMar 1, 2017
@xabbuh
Copy link
Member

The code PR was merged.

@jameshalsall Thank you for the contribution. Can you fix the conflicts here?

@jameshalsall
Copy link
ContributorAuthor

@xabbuh I will sort this out this week :)

@HeahDude
Copy link
Contributor

@jameshalsall Will you have time to finish this PR or do you want we to take care of it? Thanks!

@javiereguiluz
Copy link
Member

Thanks James.

javiereguiluz added a commit that referenced this pull requestJan 9, 2018
… handler (jameshalsall)This PR was submitted for the master branch but it was merged into the 3.3 branch instead (closes#6948).Discussion----------Update docs for setting custom response code in exception handlerDocs update for the changes applied insymfony/symfony#19822Commits-------5f0becf Update docs for setting custom response code in exception handler
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

6 participants

@jameshalsall@xabbuh@HeahDude@javiereguiluz@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp