From dca2091351bdcad484df898d28c3be465f8bd756 Mon Sep 17 00:00:00 2001 From: Jiri Pokorny Date: Sun, 21 Jan 2018 21:02:43 +0100 Subject: [PATCH] Fix content-type header match when parsing PSR request. --- src/Server/Helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Server/Helper.php b/src/Server/Helper.php index 1957fec..d7e62a8 100644 --- a/src/Server/Helper.php +++ b/src/Server/Helper.php @@ -482,9 +482,9 @@ class Helper throw new RequestError('Missing "Content-Type" header'); } - if (stripos('application/graphql', $contentType[0]) !== false) { + if (stripos($contentType[0], 'application/graphql') !== false) { $bodyParams = ['query' => $request->getBody()->getContents()]; - } else if (stripos('application/json', $contentType[0]) !== false) { + } else if (stripos($contentType[0], 'application/json') !== false) { $bodyParams = $request->getParsedBody(); if (null === $bodyParams) {