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 Apr 2, 2018
1 parent c11f03a commit 8d40983
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())
&& (Request::METHOD_POST === $request->getMethod() || Request::METHOD_PUT === $request->getMethod())
)
) {
return;
}
Expand Down

0 comments on commit 8d40983

Please sign in to comment.