Skip to content

Instantly share code, notes, and snippets.

@OniOni
Created May 18, 2012 20:34
Show Gist options
  • Save OniOni/2727469 to your computer and use it in GitHub Desktop.
Save OniOni/2727469 to your computer and use it in GitHub Desktop.
Diff for making php-webdriver work on saucelabs
diff --git a/PHPWebDriver/WebDriverBase.php b/PHPWebDriver/WebDriverBase.php
index 1f2bc78..c5f0708 100644
--- a/PHPWebDriver/WebDriverBase.php
+++ b/PHPWebDriver/WebDriverBase.php
@@ -144,6 +144,8 @@ abstract class PHPWebDriver_WebDriverBase {
curl_setopt($curl, CURLOPT_POST, true);
if ($params && is_array($params)) {
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));
+ } else {
+ curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-length: 0'));
}
} else if ($http_method == 'DELETE') {
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment