Merge pull request #232 from Poky85/fix-content-type-header

Fix Standard Server PSR request parsing
This commit is contained in:
Vladimir Razuvaev 2018-01-22 13:21:18 +07:00 committed by GitHub
commit ccecc3ce1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {