Skip to content

Commit

Permalink
Fix Json RGPD data export
Browse files Browse the repository at this point in the history
 * fix issue of double json serialization
  • Loading branch information
Stoakes committed Aug 19, 2020
1 parent 16db796 commit 5659b99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/Privacy/PrivacyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
Expand Down Expand Up @@ -138,7 +138,7 @@ private function export(Personne $personne, SerializerInterface $serializer)
{
$data = $serializer->serialize($personne, 'json', ['groups' => ['gdpr']]);

$response = new JsonResponse($data);
$response = new Response($data);
$response->headers->set('Cache-Control', 'private');
$response->headers->set('Content-type', 'application/json');
$response->headers->set('Content-Disposition', 'attachment; filename="Export-RGPD-' . date('Y-m-d') . '-' . $personne->getNom() . '.json";');
Expand Down

0 comments on commit 5659b99

Please sign in to comment.