Skip to content

Commit

Permalink
Allow a POST request to have an empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
gorghoa committed Mar 21, 2018
1 parent c11f03a commit 9fdd5f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/EventListener/DeserializeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ public function onKernelRequest(GetResponseEvent $event)
|| $request->isMethod('DELETE')
|| !($attributes = RequestAttributesExtractor::extractAttributes($request))
|| !$attributes['receive']
|| ('' === ($requestContent = $request->getContent()) && $request->isMethod('PUT'))
|| (
'' === ($requestContent = $request->getContent())
&& in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT])
)
) {
return;
}
Expand Down

0 comments on commit 9fdd5f9

Please sign in to comment.