mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-12-02 01:36:03 +03:00
Fix content-type header match when parsing PSR request.
This commit is contained in:
parent
7310b25730
commit
dca2091351
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user