Skip to content

Commit

Permalink
Merge pull request #5238 from cakephp/issue-5215
Browse files Browse the repository at this point in the history
Fix PATCH not automatically decoding known request bodies.
  • Loading branch information
lorenzo committed Nov 23, 2014
2 parents 02818c0 + 539f0f6 commit 4a3eaa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Controller/Component/RequestHandlerComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ public function requestedWith($type = null) {
$request = $this->request;
if (!$request->is('post') &&
!$request->is('put') &&
!$request->is('patch') &&
!$request->is('delete')
) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ public function testRequestContentTypes() {
$result = $this->RequestHandler->requestedWith(array('rss', 'atom'));
$this->assertFalse($result);

$this->request->env('REQUEST_METHOD', 'PATCH');
$this->assertEquals('json', $this->RequestHandler->requestedWith());

$this->request->env('REQUEST_METHOD', 'DELETE');
$this->assertEquals('json', $this->RequestHandler->requestedWith());

Expand Down

0 comments on commit 4a3eaa7

Please sign in to comment.