From 2c3d4d4d5df7321275fbd64aa6b752db39df7f54 Mon Sep 17 00:00:00 2001
From: Gabriel Bull <g.ames-bull@tangente.co>
Date: Fri, 31 May 2013 08:28:28 -0400
Subject: [PATCH 1/8] Ratchet does not work with guzzle/http 3.6

Getting this error
Object of class Guzzle\Http\Message\Header could not be converted to int
---
 composer.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index f83a0b0..1aa42a1 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
   , "require": {
         "php": ">=5.3.3"
       , "react/socket": "0.2.*"
-      , "guzzle/http": "~3.0"
+      , "guzzle/http": ">=3.0,<=3.5"
       , "symfony/http-foundation": "~2.1"
     }
 }

From 49c39485e8aa9ed64edc4d64bcb9f1d74bd0ef1e Mon Sep 17 00:00:00 2001
From: Barbarrosa <fennasnogothrim@gmail.com>
Date: Fri, 31 May 2013 22:55:00 -0600
Subject: [PATCH 2/8] Fixed type conversion issue with isProtocol method in
 RFC6455

I encountered the following error while attempting to use Ratchet. The __toString version of the request contained the correct value (13), so I cast the result to a string before casting it to an integer.

Notice: Object of class Guzzle\Http\Message\Header could not be converted to int in [file system path]\vendor\cboden\ratchet\src\Ratchet\WebSocket\Version\RFC6455.php on line 53
---
 src/Ratchet/WebSocket/Version/RFC6455.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Ratchet/WebSocket/Version/RFC6455.php b/src/Ratchet/WebSocket/Version/RFC6455.php
index 94416c3..aab0435 100644
--- a/src/Ratchet/WebSocket/Version/RFC6455.php
+++ b/src/Ratchet/WebSocket/Version/RFC6455.php
@@ -50,7 +50,7 @@ class RFC6455 implements VersionInterface {
      * {@inheritdoc}
      */
     public function isProtocol(RequestInterface $request) {
-        $version = (int)$request->getHeader('Sec-WebSocket-Version', -1);
+        $version = (int)((string)($request->getHeader('Sec-WebSocket-Version', -1)));
 
         return ($this->getVersionNumber() === $version);
     }
@@ -268,4 +268,4 @@ class RFC6455 implements VersionInterface {
         $this->closeCodes[Frame::CLOSE_SRV_ERR]     = true;
         //$this->closeCodes[Frame::CLOSE_TLS]         = true;
     }
-}
\ No newline at end of file
+}

From 7bfa2d054ea2af40b2edbfb15128de4cc49f00cd Mon Sep 17 00:00:00 2001
From: Barbarrosa <fennasnogothrim@gmail.com>
Date: Fri, 31 May 2013 23:08:27 -0600
Subject: [PATCH 3/8] Update HyBi10.php

I encountered the following error while attempting to use Ratchet. The __toString version of the request should contain the proper value, and retrieving the string before converting to an int would prevent this typecasting issue.

Notice: Object of class Guzzle\Http\Message\Header could not be converted to int in [file system path]\vendor\cboden\ratchet\src\Ratchet\WebSocket\Version\HyBi10.php on line 7
---
 src/Ratchet/WebSocket/Version/HyBi10.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Ratchet/WebSocket/Version/HyBi10.php b/src/Ratchet/WebSocket/Version/HyBi10.php
index f557a18..0ac41fa 100644
--- a/src/Ratchet/WebSocket/Version/HyBi10.php
+++ b/src/Ratchet/WebSocket/Version/HyBi10.php
@@ -4,11 +4,11 @@ use Guzzle\Http\Message\RequestInterface;
 
 class HyBi10 extends RFC6455 {
     public function isProtocol(RequestInterface $request) {
-        $version = (int)$request->getHeader('Sec-WebSocket-Version', -1);
+        $version = (int)((string)($request->getHeader('Sec-WebSocket-Version', -1)));
         return ($version >= 6 && $version < 13);
     }
 
     public function getVersionNumber() {
         return 6;
     }
-}
\ No newline at end of file
+}

From 8e92f5fd9a059279e14db60763439448f0af76b4 Mon Sep 17 00:00:00 2001
From: Chris Boden <cboden@gmail.com>
Date: Sat, 1 Jun 2013 20:24:11 -0400
Subject: [PATCH 4/8] Fixing more Guzzle API breaks

---
 composer.json                                 |  2 +-
 composer.lock                                 | 74 ++++++++++---------
 src/Ratchet/WebSocket/Version/Hixie76.php     |  8 +-
 src/Ratchet/WebSocket/Version/HyBi10.php      |  3 +-
 src/Ratchet/WebSocket/Version/RFC6455.php     |  4 +-
 .../Version/RFC6455/HandshakeVerifier.php     |  8 +-
 6 files changed, 54 insertions(+), 45 deletions(-)

diff --git a/composer.json b/composer.json
index 1aa42a1..f83a0b0 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
   , "require": {
         "php": ">=5.3.3"
       , "react/socket": "0.2.*"
-      , "guzzle/http": ">=3.0,<=3.5"
+      , "guzzle/http": "~3.0"
       , "symfony/http-foundation": "~2.1"
     }
 }
diff --git a/composer.lock b/composer.lock
index 9df5a60..756f447 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1,4 +1,8 @@
 {
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
+    ],
     "hash": "9ccce99ef687cb79dad8a4c581f38cc5",
     "packages": [
         {
@@ -24,6 +28,7 @@
                     "Evenement": "src"
                 }
             },
+            "notification-url": "https://packagist.org/downloads/",
             "license": [
                 "MIT"
             ],
@@ -42,17 +47,17 @@
         },
         {
             "name": "guzzle/common",
-            "version": "v3.3.0",
+            "version": "v3.6.0",
             "target-dir": "Guzzle/Common",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/common.git",
-                "reference": "v3.3.0"
+                "reference": "v3.6.0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/common/zipball/v3.3.0",
-                "reference": "v3.3.0",
+                "url": "https://api.github.com/repos/guzzle/common/zipball/v3.6.0",
+                "reference": "v3.6.0",
                 "shasum": ""
             },
             "require": {
@@ -62,7 +67,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "3.0-dev"
+                    "dev-master": "3.6-dev"
                 }
             },
             "autoload": {
@@ -82,21 +87,21 @@
                 "event",
                 "exception"
             ],
-            "time": "2013-03-04 00:41:45"
+            "time": "2013-05-30 07:01:25"
         },
         {
             "name": "guzzle/http",
-            "version": "v3.3.0",
+            "version": "v3.6.0",
             "target-dir": "Guzzle/Http",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/http.git",
-                "reference": "v3.3.0"
+                "reference": "v3.6.0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/http/zipball/v3.3.0",
-                "reference": "v3.3.0",
+                "url": "https://api.github.com/repos/guzzle/http/zipball/v3.6.0",
+                "reference": "v3.6.0",
                 "shasum": ""
             },
             "require": {
@@ -111,7 +116,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "3.0-dev"
+                    "dev-master": "3.6-dev"
                 }
             },
             "autoload": {
@@ -139,21 +144,21 @@
                 "http",
                 "http client"
             ],
-            "time": "2013-03-03 21:40:51"
+            "time": "2013-05-30 07:01:25"
         },
         {
             "name": "guzzle/parser",
-            "version": "v3.3.0",
+            "version": "v3.6.0",
             "target-dir": "Guzzle/Parser",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/parser.git",
-                "reference": "v3.3.0"
+                "reference": "v3.6.0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/parser/zipball/v3.3.0",
-                "reference": "v3.3.0",
+                "url": "https://api.github.com/repos/guzzle/parser/zipball/v3.6.0",
+                "reference": "v3.6.0",
                 "shasum": ""
             },
             "require": {
@@ -162,7 +167,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "3.0-dev"
+                    "dev-master": "3.6-dev"
                 }
             },
             "autoload": {
@@ -183,31 +188,34 @@
                 "message",
                 "url"
             ],
-            "time": "2013-01-12 21:43:21"
+            "time": "2013-05-30 07:01:25"
         },
         {
             "name": "guzzle/stream",
-            "version": "v3.3.0",
+            "version": "v3.6.0",
             "target-dir": "Guzzle/Stream",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/stream.git",
-                "reference": "v3.3.0"
+                "reference": "v3.6.0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/stream/zipball/v3.3.0",
-                "reference": "v3.3.0",
+                "url": "https://api.github.com/repos/guzzle/stream/zipball/v3.6.0",
+                "reference": "v3.6.0",
                 "shasum": ""
             },
             "require": {
                 "guzzle/common": "self.version",
                 "php": ">=5.3.2"
             },
+            "suggest": {
+                "guzzle/http": "To convert Guzzle request objects to PHP streams"
+            },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "3.0-dev"
+                    "dev-master": "3.6-dev"
                 }
             },
             "autoload": {
@@ -233,7 +241,7 @@
                 "component",
                 "stream"
             ],
-            "time": "2013-03-03 03:07:02"
+            "time": "2013-05-30 07:01:25"
         },
         {
             "name": "react/event-loop",
@@ -367,17 +375,17 @@
         },
         {
             "name": "symfony/event-dispatcher",
-            "version": "v2.2.0",
+            "version": "v2.2.1",
             "target-dir": "Symfony/Component/EventDispatcher",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/EventDispatcher.git",
-                "reference": "v2.2.0-RC3"
+                "reference": "v2.2.1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.2.0-RC3",
-                "reference": "v2.2.0-RC3",
+                "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.2.1",
+                "reference": "v2.2.1",
                 "shasum": ""
             },
             "require": {
@@ -421,17 +429,17 @@
         },
         {
             "name": "symfony/http-foundation",
-            "version": "v2.2.0",
+            "version": "v2.2.1",
             "target-dir": "Symfony/Component/HttpFoundation",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/HttpFoundation.git",
-                "reference": "v2.2.0"
+                "reference": "v2.2.1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.2.0",
-                "reference": "v2.2.0",
+                "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.2.1",
+                "reference": "v2.2.1",
                 "shasum": ""
             },
             "require": {
@@ -467,7 +475,7 @@
             ],
             "description": "Symfony HttpFoundation Component",
             "homepage": "http://symfony.com",
-            "time": "2013-02-26 09:42:13"
+            "time": "2013-04-06 10:15:43"
         }
     ],
     "packages-dev": [
diff --git a/src/Ratchet/WebSocket/Version/Hixie76.php b/src/Ratchet/WebSocket/Version/Hixie76.php
index 069263a..8b0e2c4 100644
--- a/src/Ratchet/WebSocket/Version/Hixie76.php
+++ b/src/Ratchet/WebSocket/Version/Hixie76.php
@@ -23,7 +23,7 @@ class Hixie76 implements VersionInterface {
      * {@inheritdoc}
      */
     public function isProtocol(RequestInterface $request) {
-        return !(null === $request->getHeader('Sec-WebSocket-Key2', true));
+        return !(null === $request->getHeader('Sec-WebSocket-Key2'));
     }
 
     /**
@@ -44,13 +44,13 @@ class Hixie76 implements VersionInterface {
             throw new \UnderflowException("Not enough data received to issue challenge response");
         }
 
-        $challenge = $this->sign($request->getHeader('Sec-WebSocket-Key1', true), $request->getHeader('Sec-WebSocket-Key2', true), $body);
+        $challenge = $this->sign((string)$request->getHeader('Sec-WebSocket-Key1'), (string)$request->getHeader('Sec-WebSocket-Key2'), $body);
 
         $headers = array(
             'Upgrade'                => 'WebSocket'
           , 'Connection'             => 'Upgrade'
-          , 'Sec-WebSocket-Origin'   => $request->getHeader('Origin', true)
-          , 'Sec-WebSocket-Location' => 'ws://' . $request->getHeader('Host', true) . $request->getPath()
+          , 'Sec-WebSocket-Origin'   => (string)$request->getHeader('Origin')
+          , 'Sec-WebSocket-Location' => 'ws://' . (string)$request->getHeader('Host') . $request->getPath()
         );
 
         $response = new Response(101, $headers, $challenge);
diff --git a/src/Ratchet/WebSocket/Version/HyBi10.php b/src/Ratchet/WebSocket/Version/HyBi10.php
index 0ac41fa..a53d338 100644
--- a/src/Ratchet/WebSocket/Version/HyBi10.php
+++ b/src/Ratchet/WebSocket/Version/HyBi10.php
@@ -4,7 +4,8 @@ use Guzzle\Http\Message\RequestInterface;
 
 class HyBi10 extends RFC6455 {
     public function isProtocol(RequestInterface $request) {
-        $version = (int)((string)($request->getHeader('Sec-WebSocket-Version', -1)));
+        $version = (int)(string)$request->getHeader('Sec-WebSocket-Version');
+
         return ($version >= 6 && $version < 13);
     }
 
diff --git a/src/Ratchet/WebSocket/Version/RFC6455.php b/src/Ratchet/WebSocket/Version/RFC6455.php
index aab0435..23e166c 100644
--- a/src/Ratchet/WebSocket/Version/RFC6455.php
+++ b/src/Ratchet/WebSocket/Version/RFC6455.php
@@ -50,7 +50,7 @@ class RFC6455 implements VersionInterface {
      * {@inheritdoc}
      */
     public function isProtocol(RequestInterface $request) {
-        $version = (int)((string)($request->getHeader('Sec-WebSocket-Version', -1)));
+        $version = (int)(string)$request->getHeader('Sec-WebSocket-Version');
 
         return ($this->getVersionNumber() === $version);
     }
@@ -73,7 +73,7 @@ class RFC6455 implements VersionInterface {
         return new Response(101, array(
             'Upgrade'              => 'websocket'
           , 'Connection'           => 'Upgrade'
-          , 'Sec-WebSocket-Accept' => $this->sign($request->getHeader('Sec-WebSocket-Key'))
+          , 'Sec-WebSocket-Accept' => $this->sign((string)$request->getHeader('Sec-WebSocket-Key'))
         ));
     }
 
diff --git a/src/Ratchet/WebSocket/Version/RFC6455/HandshakeVerifier.php b/src/Ratchet/WebSocket/Version/RFC6455/HandshakeVerifier.php
index 7fbf452..838a047 100644
--- a/src/Ratchet/WebSocket/Version/RFC6455/HandshakeVerifier.php
+++ b/src/Ratchet/WebSocket/Version/RFC6455/HandshakeVerifier.php
@@ -19,10 +19,10 @@ class HandshakeVerifier {
         $passes += (int)$this->verifyMethod($request->getMethod());
         $passes += (int)$this->verifyHTTPVersion($request->getProtocolVersion());
         $passes += (int)$this->verifyRequestURI($request->getPath());
-        $passes += (int)$this->verifyHost($request->getHeader('Host', true));
-        $passes += (int)$this->verifyUpgradeRequest($request->getHeader('Upgrade', true));
-        $passes += (int)$this->verifyConnection($request->getHeader('Connection', true));
-        $passes += (int)$this->verifyKey($request->getHeader('Sec-WebSocket-Key', true));
+        $passes += (int)$this->verifyHost((string)$request->getHeader('Host'));
+        $passes += (int)$this->verifyUpgradeRequest((string)$request->getHeader('Upgrade'));
+        $passes += (int)$this->verifyConnection((string)$request->getHeader('Connection'));
+        $passes += (int)$this->verifyKey((string)$request->getHeader('Sec-WebSocket-Key'));
         //$passes += (int)$this->verifyVersion($headers['Sec-WebSocket-Version']); // Temporarily breaking functionality
 
         return (7 === $passes);

From b93581cdcd57e0c9a7eb04e8ef470304bb951421 Mon Sep 17 00:00:00 2001
From: Chris Boden <cboden@gmail.com>
Date: Sat, 1 Jun 2013 20:25:31 -0400
Subject: [PATCH 5/8] Version bump

---
 CHANGELOG.md                        | 4 ++++
 src/Ratchet/ConnectionInterface.php | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13fb90f..c090901 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ CHANGELOG
 
 ---
 
+* 0.2.6 (2013-06-01)
+
+ * Guzzle 3.6 support
+
 * 0.2.5 (2013-04-01)
 
  * Fixed Hixie-76 handshake bug
diff --git a/src/Ratchet/ConnectionInterface.php b/src/Ratchet/ConnectionInterface.php
index cc4d74b..3c2e5d6 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.2.5';
+const VERSION = 'Ratchet/0.2.6';
 
 /**
  * A proxy object representing a connection to the application

From b21b2007c5ee6050ca29144f3bfbde37fc53e92d Mon Sep 17 00:00:00 2001
From: Chris Boden <cboden@gmail.com>
Date: Sun, 9 Jun 2013 11:10:22 -0400
Subject: [PATCH 6/8] Guzzle 3.6 conformance

Updated inheritance class to match API change
Use new Guzzle Header class when searching for values
Lock Ratchet into using Guzzle 3.6 to future-proof
---
 composer.json                                 |  2 +-
 composer.lock                                 | 30 +++++++++----------
 .../Guzzle/Http/Message/RequestFactory.php    |  2 +-
 src/Ratchet/WebSocket/WsServer.php            |  7 +++--
 4 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/composer.json b/composer.json
index f83a0b0..92cc54c 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
   , "require": {
         "php": ">=5.3.3"
       , "react/socket": "0.2.*"
-      , "guzzle/http": "~3.0"
+      , "guzzle/http": "3.6.*"
       , "symfony/http-foundation": "~2.1"
     }
 }
diff --git a/composer.lock b/composer.lock
index 756f447..ca73540 100644
--- a/composer.lock
+++ b/composer.lock
@@ -3,7 +3,7 @@
         "This file locks the dependencies of your project to a known state",
         "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
     ],
-    "hash": "9ccce99ef687cb79dad8a4c581f38cc5",
+    "hash": "b5fee3d5d9c4f60b01030a234d8673f5",
     "packages": [
         {
             "name": "evenement/evenement",
@@ -375,17 +375,17 @@
         },
         {
             "name": "symfony/event-dispatcher",
-            "version": "v2.2.1",
+            "version": "v2.3.0",
             "target-dir": "Symfony/Component/EventDispatcher",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/EventDispatcher.git",
-                "reference": "v2.2.1"
+                "reference": "v2.3.0-RC1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.2.1",
-                "reference": "v2.2.1",
+                "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.3.0-RC1",
+                "reference": "v2.3.0-RC1",
                 "shasum": ""
             },
             "require": {
@@ -395,13 +395,13 @@
                 "symfony/dependency-injection": ">=2.0,<3.0"
             },
             "suggest": {
-                "symfony/dependency-injection": "2.2.*",
-                "symfony/http-kernel": "2.2.*"
+                "symfony/dependency-injection": "",
+                "symfony/http-kernel": ""
             },
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "2.2-dev"
+                    "dev-master": "2.3-dev"
                 }
             },
             "autoload": {
@@ -425,21 +425,21 @@
             ],
             "description": "Symfony EventDispatcher Component",
             "homepage": "http://symfony.com",
-            "time": "2013-02-11 11:26:43"
+            "time": "2013-05-13 14:36:40"
         },
         {
             "name": "symfony/http-foundation",
-            "version": "v2.2.1",
+            "version": "v2.3.0",
             "target-dir": "Symfony/Component/HttpFoundation",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/HttpFoundation.git",
-                "reference": "v2.2.1"
+                "reference": "v2.3.0-RC1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.2.1",
-                "reference": "v2.2.1",
+                "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.3.0-RC1",
+                "reference": "v2.3.0-RC1",
                 "shasum": ""
             },
             "require": {
@@ -448,7 +448,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "2.2-dev"
+                    "dev-master": "2.3-dev"
                 }
             },
             "autoload": {
@@ -475,7 +475,7 @@
             ],
             "description": "Symfony HttpFoundation Component",
             "homepage": "http://symfony.com",
-            "time": "2013-04-06 10:15:43"
+            "time": "2013-05-10 06:00:03"
         }
     ],
     "packages-dev": [
diff --git a/src/Ratchet/WebSocket/Guzzle/Http/Message/RequestFactory.php b/src/Ratchet/WebSocket/Guzzle/Http/Message/RequestFactory.php
index c1f6b45..64b6302 100644
--- a/src/Ratchet/WebSocket/Guzzle/Http/Message/RequestFactory.php
+++ b/src/Ratchet/WebSocket/Guzzle/Http/Message/RequestFactory.php
@@ -7,7 +7,7 @@ class RequestFactory extends GuzzleRequestFactory {
     /**
      * {@inheritdoc}
      */
-    public function create($method, $url, $headers = null, $body = '') {
+    public function create($method, $url, $headers = null, $body = '', array $options = array()) {
         $c = $this->entityEnclosingRequestClass;
         $request = new $c($method, $url, $headers);
         $request->setBody(EntityBody::factory($body));
diff --git a/src/Ratchet/WebSocket/WsServer.php b/src/Ratchet/WebSocket/WsServer.php
index 281f16c..dbc8104 100644
--- a/src/Ratchet/WebSocket/WsServer.php
+++ b/src/Ratchet/WebSocket/WsServer.php
@@ -117,9 +117,10 @@ class WsServer implements MessageComponentInterface {
             return;
         }
 
-        // This needs to be refactored later on, incorporated with routing
-        if ('' !== ($agreedSubProtocols = $this->getSubProtocolString($from->WebSocket->request->getTokenizedHeader('Sec-WebSocket-Protocol', ',')))) {
-            $response->setHeader('Sec-WebSocket-Protocol', $agreedSubProtocols);
+        if (null !== ($subHeader = $from->WebSocket->request->getHeader('Sec-WebSocket-Protocol'))) {
+            if ('' !== ($agreedSubProtocols = $this->getSubProtocolString($subHeader->normalize()))) {
+                $response->setHeader('Sec-WebSocket-Protocol', $agreedSubProtocols);
+            }
         }
 
         $response->setHeader('X-Powered-By', \Ratchet\VERSION);

From 435315c782b1a31b7bc5ac7f636f8403d90e3bf3 Mon Sep 17 00:00:00 2001
From: Chris Boden <cboden@gmail.com>
Date: Sun, 9 Jun 2013 11:21:39 -0400
Subject: [PATCH 7/8] Fixed broken unit test with Symfony 2.3

---
 tests/Ratchet/Tests/Session/SessionComponentTest.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/Ratchet/Tests/Session/SessionComponentTest.php b/tests/Ratchet/Tests/Session/SessionComponentTest.php
index ed75191..b991a03 100644
--- a/tests/Ratchet/Tests/Session/SessionComponentTest.php
+++ b/tests/Ratchet/Tests/Session/SessionComponentTest.php
@@ -55,6 +55,7 @@ class SessionProviderTest extends \PHPUnit_Framework_TestCase {
         );
 
         $pdo = new \PDO("sqlite::memory:");
+        $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
         $pdo->exec(vsprintf("CREATE TABLE %s (%s VARCHAR(255) PRIMARY KEY, %s TEXT, %s INTEGER)", $dbOptions));
         $pdo->prepare(vsprintf("INSERT INTO %s (%s, %s, %s) VALUES (?, ?, ?)", $dbOptions))->execute(array($sessionId, base64_encode('_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}'), time()));
 

From 6c0a8550dd34fc629af18ddaf82fc0d9ed45948c Mon Sep 17 00:00:00 2001
From: Chris Boden <cboden@gmail.com>
Date: Sun, 9 Jun 2013 11:41:03 -0400
Subject: [PATCH 8/8] Version bump fixes #99

---
 CHANGELOG.md                        | 4 ++++
 README.md                           | 2 +-
 src/Ratchet/ConnectionInterface.php | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c090901..5f9f7f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ CHANGELOG
 
 ---
 
+* 0.2.7 (2013-06-09)
+
+ * BF: Sub-protocol negotation with Guzzle 3.6
+
 * 0.2.6 (2013-06-01)
 
  * Guzzle 3.6 support
diff --git a/README.md b/README.md
index 1c36118..092a9dc 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ Build up your application through simple interfaces and re-use your application
 ##WebSocket Compliance
 
 * Supports the RFC6455, HyBi-10+, and Hixie76 protocol versions (at the same time)
-* Tested on Chrome 13 - 26, Firefox 6 - 20, Safari 5.0.1 - 6, iOS 4.2 - 6
+* Tested on Chrome 13 - 27, Firefox 6 - 21, Safari 5.0.1 - 6, iOS 4.2 - 6
 * Ratchet [passes](http://socketo.me/reports/ab/) the [Autobahn Testsuite](http://autobahn.ws/testsuite) (non-binary messages)
 
 ##Requirements
diff --git a/src/Ratchet/ConnectionInterface.php b/src/Ratchet/ConnectionInterface.php
index 3c2e5d6..eba0fd9 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.2.6';
+const VERSION = 'Ratchet/0.2.7';
 
 /**
  * A proxy object representing a connection to the application