merged branch fabpot/json-response (PR #7846)

This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] added a note about JSON responses as arrays (refs #6970)

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6970
| License       | MIT
| Doc PR        | symfony/symfony-docs#2555

Commits
-------

abb32a1 [HttpFoundation] added a note about JSON responses as arrays (refs #6970)
This commit is contained in:
Fabien Potencier 2013-04-25 15:24:03 +02:00
commit 1362b388df
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,12 @@ namespace Symfony\Component\HttpFoundation;
/**
* Response represents an HTTP response in JSON format.
*
* Note that this class does not force the returned JSON content to be an
* object. It is however recommended that you do return an object as it
* protects yourself against XSSI and JSON-JavaScript Hijacking.
*
* @see https://www.owasp.org/index.php/OWASP_AJAX_Security_Guidelines#Always_return_JSON_with_an_Object_on_the_outside
*
* @author Igor Wiedler <igor@wiedler.ch>
*/
class JsonResponse extends Response