Fix content-type header match when parsing PSR request.

(cherry picked from commit dca2091)
This commit is contained in:
Jiri Pokorny 2018-01-22 04:02:43 +08:00 committed by Vladimir Razuvaev
parent 26b445515f
commit 96047246c6

View File

@ -482,9 +482,9 @@ class Helper
throw new RequestError('Missing "Content-Type" header'); 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()]; $bodyParams = ['query' => $request->getBody()->getContents()];
} else if (stripos('application/json', $contentType[0]) !== false) { } else if (stripos($contentType[0], 'application/json') !== false) {
$bodyParams = $request->getParsedBody(); $bodyParams = $request->getParsedBody();
if (null === $bodyParams) { if (null === $bodyParams) {