diff --git a/tests/unit/Http/RouterTest.php b/tests/unit/Http/RouterTest.php index e924aa1..e6ecb7c 100644 --- a/tests/unit/Http/RouterTest.php +++ b/tests/unit/Http/RouterTest.php @@ -3,6 +3,10 @@ namespace Ratchet\Http; use Ratchet\WebSocket\WsServerInterface; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\Matcher\UrlMatcherInterface; +use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\RouteCollection; +use Symfony\Component\Routing\Matcher\UrlMatcher; + /** * @covers Ratchet\Http\Router @@ -142,4 +146,18 @@ class RouterTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('ws', $request->getUri()->getScheme()); $this->assertEquals('doesnt.matter', $request->getUri()->getHost()); } + + public function testImpatientClientOverflow() { + $header = "GET /nope HTTP/1.1 +Upgrade: websocket +Connection: upgrade +Host: localhost +Origin: http://localhost +Sec-WebSocket-Version: 13\r\n\r\n"; + + $app = new HttpServer(new Router(new UrlMatcher(new RouteCollection, new RequestContext))); + $app->onOpen($this->_conn); + $app->onMessage($this->_conn, $header); + $app->onMessage($this->_conn, 'Silly body'); + } }