Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Provide less state in getRequestFormat#21805
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fabpot commentedFeb 28, 2017
LGTM, should be merged in 2.7 though (can you change the branch target of the PR?) |
nicolas-grekas commentedMar 4, 2017
Thank you@dawehner. |
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes#21805).Discussion----------Provide less state in getRequestFormatLet's assume you multiple lines of code calling to ```Request::getRequestFormat```providing different default values.```$request->getRequestFormat();$request->getRequestFormat('json')```As of HEAD this causes the second call to return 'html', unless its set explicit via ```setRequestFormat()```.IMHO this is state which can be avoided.Note: This also helps Drupal.| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | no| Fixed tickets || License | MIT| Doc PR |Commits-------1d43007 Provide less state in getRequestFormat
dawehner commentedMar 4, 2017
@fabpot Sorry for not finding the time to update the PR |
* Fix check in MarkupListenerAn update in Symfony has changed the way the request format is returned. Thishas broken a check in the MarkupBundle and prevents it from running at all.Removing the 'null' parameter from the function call fixes the issue but needsmore testing.Related change in Symfony:symfony/symfony#21805* Changelog update* added fix for BinaryFileResponse
* Fix check in MarkupListenerAn update in Symfony has changed the way the request format is returned. Thishas broken a check in the MarkupBundle and prevents it from running at all.Removing the 'null' parameter from the function call fixes the issue but needsmore testing.Related change in Symfony:symfony/symfony#21805* Changelog update* added fix for BinaryFileResponse
dominikzogg commentedMar 23, 2017
please do not break things within bugfix releases, we need to provide content-type: application/json even on emtpy responses (i know its against the specs) but it sould be possible to do so |
Let's assume you multiple lines of code calling to
Request::getRequestFormatproviding different default values.As of HEAD this causes the second call to return 'html', unless its set explicit via
setRequestFormat().IMHO this is state which can be avoided.
Note: This also helps Drupal.