Skip to content

Commit

Permalink
Merge pull request #232 from Poky85/fix-content-type-header
Browse files Browse the repository at this point in the history
Fix Standard Server PSR request parsing
  • Loading branch information
vladar committed Jan 22, 2018
2 parents 7310b25 + dca2091 commit ccecc3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Server/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ public function parsePsrRequest(ServerRequestInterface $request)
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) {
Expand Down

0 comments on commit ccecc3c

Please sign in to comment.