summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-04-17 07:07:09 +0000
committerDries Buytaert <dries@buytaert.net>2009-04-17 07:07:09 +0000
commit9179976227e4c5c6aaf2b92641b377c1de95b42a (patch)
treede6cc2256c674846264dbc269eaf58ec99cdf922 /modules/simpletest/drupal_web_test_case.php
parent34cd317476b9b8e5ebc43d845702b1feaa576afd (diff)
downloadbrdo-9179976227e4c5c6aaf2b92641b377c1de95b42a.tar.gz
brdo-9179976227e4c5c6aaf2b92641b377c1de95b42a.tar.bz2
- Patch #434336 by klausi: fixed simpletest on lighttpd. Curl header funkiness.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 8004b40dd..fac82f0d5 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -983,6 +983,14 @@ class DrupalWebTestCase {
protected function curlExec($curl_options) {
$this->curlInitialize();
$url = empty($curl_options[CURLOPT_URL]) ? curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL) : $curl_options[CURLOPT_URL];
+ if (!empty($curl_options[CURLOPT_POST])) {
+ // This is a fix for the Curl library to prevent Expect: 100-continue
+ // headers in POST requests, that may cause unexpected HTTP response
+ // codes from some webservers (like lighttpd that returns a 417 error
+ // code). It is done by setting an empty "Expect" header field that is
+ // not overwritten by Curl.
+ $curl_options[CURLOPT_HTTPHEADER][] = 'Expect:';
+ }
curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
$this->headers = array();
$this->drupalSetContent(curl_exec($this->curlHandle), curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL));