diff --git a/src/Illuminate/Http/Request.php b/src/Illuminate/Http/Request.php index bf2d7165f7b2..766c7f17dfde 100644 --- a/src/Illuminate/Http/Request.php +++ b/src/Illuminate/Http/Request.php @@ -340,7 +340,7 @@ protected function getInputSource() return $this->json(); } - return $this->getRealMethod() == 'GET' ? $this->query : $this->request; + return in_array($this->getRealMethod(), ['GET', 'HEAD']) ? $this->query : $this->request; } /** diff --git a/tests/Http/HttpRequestTest.php b/tests/Http/HttpRequestTest.php index c5df7c7f5a93..1df81173e202 100644 --- a/tests/Http/HttpRequestTest.php +++ b/tests/Http/HttpRequestTest.php @@ -482,6 +482,13 @@ public function testReplaceMethod() $this->assertEquals('Dayle', $request->input('buddy')); } + public function testOffsetUnsetMethod() + { + $request = Request::create('/', 'HEAD', ['name' => 'Taylor']); + $request->offsetUnset('name'); + $this->assertNull($request->input('name')); + } + public function testHeaderMethod() { $request = Request::create('/', 'GET', [], [], [], ['HTTP_DO_THIS' => 'foo']);