From 56c07ce4b8310d8df1244350f93fdc21b32e4e6f Mon Sep 17 00:00:00 2001 From: samizdam Date: Fri, 25 Nov 2016 20:59:11 +0300 Subject: [PATCH 1/4] Factory new Request Url from url, instead path only: keep original request host, scheme, etc. --- src/Ratchet/Http/Router.php | 2 +- tests/unit/Http/RouterTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Ratchet/Http/Router.php b/src/Ratchet/Http/Router.php index bfc8193..ae52e0a 100644 --- a/src/Ratchet/Http/Router.php +++ b/src/Ratchet/Http/Router.php @@ -55,7 +55,7 @@ class Router implements HttpServerInterface { } $parameters = array_merge($parameters, $request->getQuery()->getAll()); - $url = Url::factory($request->getPath()); + $url = Url::factory($request->getUrl()); $url->setQuery($parameters); $request->setUrl($url); diff --git a/tests/unit/Http/RouterTest.php b/tests/unit/Http/RouterTest.php index 5a1128e..2b07cf7 100644 --- a/tests/unit/Http/RouterTest.php +++ b/tests/unit/Http/RouterTest.php @@ -127,6 +127,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase { ); $conn = $this->getMock('Ratchet\Mock\Connection'); + /**@var $request \Guzzle\Http\Message\Request */ $request = $this->getMock('Guzzle\Http\Message\Request', array('getPath'), array('GET', ''), '', false); $request->setHeaderFactory($this->getMock('Guzzle\Http\Message\Header\HeaderFactoryInterface')); @@ -136,5 +137,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase { $router->onOpen($conn, $request); $this->assertEquals(array('foo' => 'nope', 'baz' => 'qux', 'hello' => 'world'), $request->getQuery()->getAll()); + $this->assertEquals('ws', $request->getScheme()); + $this->assertEquals('doesnt.matter', $request->getHost()); } } From 64bc5822c80ce6c16d5033fa63eb10c997cd30f9 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Fri, 30 Dec 2016 13:26:04 -0500 Subject: [PATCH 2/4] Set GET required in Symfony Route --- src/Ratchet/App.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ratchet/App.php b/src/Ratchet/App.php index b7d0e55..c52a2c7 100644 --- a/src/Ratchet/App.php +++ b/src/Ratchet/App.php @@ -132,7 +132,7 @@ class App { } } - $this->routes->add('rr-' . ++$this->_routeCounter, new Route($path, array('_controller' => $decorated), array('Origin' => $this->httpHost), array(), $httpHost)); + $this->routes->add('rr-' . ++$this->_routeCounter, new Route($path, array('_controller' => $decorated), array('Origin' => $this->httpHost), array(), $httpHost, array(), array('GET'))); return $decorated; } From afe63e26d67d73d720a33f2efaf190f576b02f86 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Fri, 30 Dec 2016 13:40:50 -0500 Subject: [PATCH 3/4] 0.3.6 prep fixes #470 fixes #471 fixes #472 --- CHANGELOG.md | 4 ++++ src/Ratchet/ConnectionInterface.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d7073b..03c62c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ CHANGELOG --- +* 0.3.6 (2015-12-30) + * BF: Keep host and scheme in HTTP request object attatched to connection + * BF: Return correct HTTP response (405) when non-GET request made + * 0.3.5 (2016-05-25) * BF: Unmask responding close frame diff --git a/src/Ratchet/ConnectionInterface.php b/src/Ratchet/ConnectionInterface.php index 882774e..1b3839c 100644 --- a/src/Ratchet/ConnectionInterface.php +++ b/src/Ratchet/ConnectionInterface.php @@ -5,7 +5,7 @@ namespace Ratchet; * The version of Ratchet being used * @var string */ -const VERSION = 'Ratchet/0.3.5'; +const VERSION = 'Ratchet/0.3.6'; /** * A proxy object representing a connection to the application From 84df35d2a6576985b9e81b564d3c25809f8d647e Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Fri, 6 Jan 2017 09:36:36 -0500 Subject: [PATCH 4/4] Release --- CHANGELOG.md | 2 +- LICENSE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c62c4..2bf1597 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ CHANGELOG --- -* 0.3.6 (2015-12-30) +* 0.3.6 (2017-01-06) * BF: Keep host and scheme in HTTP request object attatched to connection * BF: Return correct HTTP response (405) when non-GET request made diff --git a/LICENSE b/LICENSE index 7f8c128..24abba1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2016 Chris Boden +Copyright (c) 2011-2017 Chris Boden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal