diff options
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 8 |
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)); |