summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateu Aguiló Bosch2017-09-15 23:32:21 +0200
committerMateu Aguiló Bosch2017-09-15 23:32:21 +0200
commit9b599ae506d7fe26fe22f476fc9be78ba2563fe1 (patch)
tree0893187adb9ff60b4919a3e5cd43fae8f3729dcf
parent5a389ac8097b9f90440836d8c07a5020e7404af1 (diff)
fix(Normalizers): Serialize body string
-rw-r--r--src/Normalizer/JsonSubrequestDenormalizer.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Normalizer/JsonSubrequestDenormalizer.php b/src/Normalizer/JsonSubrequestDenormalizer.php
index e0d4540..75ef331 100644
--- a/src/Normalizer/JsonSubrequestDenormalizer.php
+++ b/src/Normalizer/JsonSubrequestDenormalizer.php
@@ -3,9 +3,6 @@
namespace Drupal\subrequests\Normalizer;
use Drupal\Component\Serialization\Json;
-use Drupal\Component\Utility\NestedArray;
-use Drupal\subrequests\Blueprint\Parser;
-use Drupal\subrequests\Blueprint\RequestTree;
use Drupal\subrequests\Subrequest;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
@@ -46,10 +43,10 @@ class JsonSubrequestDenormalizer implements DenormalizerInterface {
$path,
static::getMethodFromAction($data->action),
empty($data->body) ? $query : $data->body,
- $master_request->cookies ? (array) $master_request->cookies->getIterator() : [],
- $master_request->files ? (array) $master_request->files->getIterator() : [],
+ $master_request->cookies ? $master_request->cookies->all() : [],
+ $master_request->files ? $master_request->files->all() : [],
[],
- empty($data->body) ? '' : $data->body
+ empty($data->body) ? '' : Json::encode($data->body)
);
// Maintain the same session as in the master request.
$session = $master_request->getSession();