From b1c59d4319413e39232c8095355db4c8be81ce2b Mon Sep 17 00:00:00 2001 From: skeptic35 Date: Mon, 8 Oct 2012 18:18:30 +0300 Subject: [PATCH] Update WebDriver/Driver.php parsing out session id failed in case Location header was not followed by \n --- WebDriver/Driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebDriver/Driver.php b/WebDriver/Driver.php index 84f5bee..dd1784f 100644 --- a/WebDriver/Driver.php +++ b/WebDriver/Driver.php @@ -39,7 +39,7 @@ protected function __construct($server_url, $capabilities) { $response = $this->execute("POST", "/session", $payload); // Parse out session id - preg_match("/\nLocation:.*\/(.*)\n/", $response['header'], $matches); + preg_match("/\nLocation:.*\/(.*)\n/", $response['header'] . "\n", $matches); if (!empty($response['body'])) { $additional_info = $response['body']; } else if (!empty($response['header'])) {