diff --git a/EventListener/JsonDecoderListener.php b/EventListener/JsonDecoderListener.php index bfaae3d..f4f253b 100644 --- a/EventListener/JsonDecoderListener.php +++ b/EventListener/JsonDecoderListener.php @@ -4,6 +4,7 @@ use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\HttpKernelInterface; /** * JsonDecoderListener. @@ -17,7 +18,9 @@ public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); - if ($request->headers->has('Content-Type')) { + if ($event->getRequestType() === HttpKernelInterface::MASTER_REQUEST + && $request->headers->has('Content-Type') + ) { $contentType = $request->headers->get('Content-Type'); if (substr_count($contentType, 'application/json') > 0) {