Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 98894fc

Browse files
Fix for creating a new session
New sessions should follow up a 300 level redirect with a GET instead of forcing another POST.
1 parent f666d1d commit 98894fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/remote/HttpCommandExecutor.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ public function execute(WebDriverCommand $command) {
184184
}
185185

186186
curl_setopt($this->curl, CURLOPT_URL, $this->url . $url);
187-
curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, $http_method);
187+
switch ($command->getName()) {
188+
case 'newSession':
189+
curl_setopt($this->curl, CURLOPT_POST, 1);
190+
break;
191+
default:
192+
curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, $http_method);
193+
}
188194
$encoded_params = null;
189195
if ($http_method === 'POST' && $params && is_array($params)) {
190196
$encoded_params = json_encode($params);

0 commit comments

Comments
 (0)