Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/4893'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function fromString($string)
$request->setMethod($matches['method']);
$request->setUri($matches['uri']);

if ($matches['version']) {
if (isset($matches['version'])) {
$request->setVersion($matches['version']);
}

Expand Down
10 changes: 10 additions & 0 deletions test/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@ public function testRequestIsFlashRequest()
$this->assertTrue($request->isFlashRequest());
}

/**
* @group 4893
*/
public function testRequestsWithoutHttpVersionAreOK()
{
$requestString = "GET http://www.domain.com/index.php";
$request = Request::fromString($requestString);
$this->assertEquals($request::METHOD_GET, $request->getMethod());
}

/**
* PHPUNIT DATA PROVIDER
*
Expand Down

0 comments on commit 6bd62cc

Please # to comment.