Use parsed body if present

This commit is contained in:
Toby Zerner 2021-09-08 21:27:42 +10:00
parent 16c56cccee
commit 2f0a524bde
2 changed files with 2 additions and 2 deletions

View File

@ -92,6 +92,6 @@ class Context
*/
public function getBody(): ?array
{
return json_decode($this->request->getBody()->getContents(), true);
return $this->request->getParsedBody() ?: json_decode($this->request->getBody()->getContents(), true);
}
}

View File

@ -50,7 +50,7 @@ final class Atomic extends Extension
throw new MethodNotAllowedException();
}
$body = $request->getParsedBody();
$body = $context->getBody();
$operations = $body['atomic:operations'] ?? null;
if (! is_array($operations)) {