From 9179976227e4c5c6aaf2b92641b377c1de95b42a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 17 Apr 2009 07:07:09 +0000 Subject: - Patch #434336 by klausi: fixed simpletest on lighttpd. Curl header funkiness. --- modules/simpletest/drupal_web_test_case.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/simpletest/drupal_web_test_case.php') 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)); -- cgit v1.2.3