Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1148
diff -u -9 -p -r1.1148 common.inc
--- includes/common.inc	22 Apr 2010 08:18:56 -0000	1.1148
+++ includes/common.inc	22 Apr 2010 20:03:37 -0000
@@ -749,19 +749,20 @@ function drupal_access_denied() {
  *   - status_message
  *       The status message from the response, if a response was received.
  *   - redirect_code
  *       If redirected, an integer containing the initial response status code.
  *   - redirect_url
  *       If redirected, a string containing the redirection location.
  *   - error
  *       If an error occurred, the error message. Otherwise not set.
  *   - headers
- *       An array containing the response headers as name/value pairs.
+ *       An array containing the response headers as name/value pairs. The keys
+ *       are lower case.
  *   - data
  *       A string containing the response body that was received.
  */
 function drupal_http_request($url, array $options = array()) {
   global $db_prefix;
 
   $result = new stdClass();
 
   // Parse the URL and make sure we can handle the schema.
@@ -896,26 +897,27 @@ function drupal_http_request($url, array
   // Parse the response status line.
   list($protocol, $code, $status_message) = explode(' ', trim(array_shift($response)), 3);
   $result->protocol = $protocol;
   $result->status_message = $status_message;
 
   $result->headers = array();
 
   // Parse the response headers.
   while ($line = trim(array_shift($response))) {
-    list($header, $value) = explode(':', $line, 2);
-    if (isset($result->headers[$header]) && $header == 'Set-Cookie') {
+    list($name, $value) = explode(':', $line, 2);
+    $name = strtolower($name);
+    if (isset($result->headers[$name]) && $name == 'set-cookie') {
       // RFC 2109: the Set-Cookie response header comprises the token Set-
       // Cookie:, followed by a comma-separated list of one or more cookies.
-      $result->headers[$header] .= ',' . trim($value);
+      $result->headers[$name] .= ',' . trim($value);
     }
     else {
-      $result->headers[$header] = trim($value);
+      $result->headers[$name] = trim($value);
     }
   }
 
   $responses = array(
     100 => 'Continue',
     101 => 'Switching Protocols',
     200 => 'OK',
     201 => 'Created',
     202 => 'Accepted',
@@ -963,19 +965,19 @@ function drupal_http_request($url, array
   $result->code = $code;
 
   switch ($code) {
     case 200: // OK
     case 304: // Not modified
       break;
     case 301: // Moved permanently
     case 302: // Moved temporarily
     case 307: // Moved temporarily
-      $location = $result->headers['Location'];
+      $location = $result->headers['location'];
       $options['timeout'] -= timer_read(__FUNCTION__) / 1000;
       if ($options['timeout'] <= 0) {
         $result->code = HTTP_REQUEST_TIMEOUT;
         $result->error = 'request timed out';
       }
       elseif ($options['max_redirects']) {
         // Redirect to the new location.
         $options['max_redirects']--;
         $result = drupal_http_request($location, $options);
Index: modules/aggregator/aggregator.parser.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.parser.inc,v
retrieving revision 1.8
diff -u -9 -p -r1.8 aggregator.parser.inc
--- modules/aggregator/aggregator.parser.inc	30 Jan 2010 07:59:24 -0000	1.8
+++ modules/aggregator/aggregator.parser.inc	22 Apr 2010 20:03:37 -0000
@@ -18,38 +18,38 @@ function aggregator_aggregator_parse_inf
 
 /**
  * Implements hook_aggregator_parse().
  */
 function aggregator_aggregator_parse($feed) {
   global $channel, $image;
 
   // Filter the input data.
   if (aggregator_parse_feed($feed->source_string, $feed)) {
-    $modified = empty($feed->http_headers['Last-Modified']) ? 0 : strtotime($feed->http_headers['Last-Modified']);
+    $modified = empty($feed->http_headers['last-modified']) ? 0 : strtotime($feed->http_headers['last-modified']);
 
     // Prepare the channel data.
     foreach ($channel as $key => $value) {
       $channel[$key] = trim($value);
     }
 
     // Prepare the image data (if any).
     foreach ($image as $key => $value) {
       $image[$key] = trim($value);
     }
 
     if (!empty($image['link']) && !empty($image['url']) && !empty($image['title'])) {
       $image = l(theme('image', array('path' => $image['url'], 'alt' => $image['title'])), $image['link'], array('html' => TRUE));
     }
     else {
       $image = '';
     }
 
-    $etag = empty($feed->http_headers['ETag']) ? '' : $feed->http_headers['ETag'];
+    $etag = empty($feed->http_headers['etag']) ? '' : $feed->http_headers['etag'];
 
     // Add parsed data to the feed object.
     $feed->link = !empty($channel['LINK']) ? $channel['LINK'] : '';
     $feed->description = !empty($channel['DESCRIPTION']) ? $channel['DESCRIPTION'] : '';
     $feed->image = $image;
     $feed->etag = $etag;
     $feed->modified = $modified;
 
     // Clear the cache.
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.84
diff -u -9 -p -r1.84 openid.module
--- modules/openid/openid.module	7 Apr 2010 16:35:03 -0000	1.84
+++ modules/openid/openid.module	22 Apr 2010 20:03:37 -0000
@@ -431,26 +431,26 @@ function _openid_xrds_discovery($claimed
 
   $xrds_url = $claimed_id;
   $scheme = @parse_url($xrds_url, PHP_URL_SCHEME);
   if ($scheme == 'http' || $scheme == 'https') {
     // For regular URLs, try Yadis resolution first, then HTML-based discovery
     $headers = array('Accept' => 'application/xrds+xml');
     $result = drupal_http_request($xrds_url, array('headers' => $headers));
 
     if (!isset($result->error)) {
-      if (isset($result->headers['Content-Type']) && preg_match("/application\/xrds\+xml/", $result->headers['Content-Type'])) {
+      if (isset($result->headers['content-type']) && preg_match("/application\/xrds\+xml/", $result->headers['content-type'])) {
         // Parse XML document to find URL
         $services = _openid_xrds_parse($result->data);
       }
       else {
         $xrds_url = NULL;
-        if (isset($result->headers['X-XRDS-Location'])) {
-          $xrds_url = $result->headers['X-XRDS-Location'];
+        if (isset($result->headers['x-xrds-location'])) {
+          $xrds_url = $result->headers['x-xrds-location'];
         }
         else {
           // Look for meta http-equiv link in HTML head
           $xrds_url = _openid_meta_httpequiv('X-XRDS-Location', $result->data);
         }
         if (!empty($xrds_url)) {
           $headers = array('Accept' => 'application/xrds+xml');
           $xrds_result = drupal_http_request($xrds_url, array('headers' => $headers));
           if (!isset($xrds_result->error)) {
Index: modules/simpletest/tests/system_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/system_test.module,v
retrieving revision 1.25
diff -u -9 -p -r1.25 system_test.module
--- modules/simpletest/tests/system_test.module	17 Feb 2010 22:44:52 -0000	1.25
+++ modules/simpletest/tests/system_test.module	22 Apr 2010 20:03:37 -0000
@@ -111,19 +111,20 @@ function system_test_sleep($seconds) {
 function system_test_basic_auth_page() {
   $output = t('$_SERVER[\'PHP_AUTH_USER\'] is @username.', array('@username' => $_SERVER['PHP_AUTH_USER']));
   $output .= t('$_SERVER[\'PHP_AUTH_PW\'] is @password.', array('@password' => $_SERVER['PHP_AUTH_PW']));
   return $output;
 }
 
 function system_test_redirect($code) {
   $code = (int)$code;
   if ($code != 200) {
-    header("Location: " . url('system-test/redirect/200', array('absolute' => TRUE)), TRUE, $code);
+    // Header names are case-insensitive.
+    header("locaTION: " . url('system-test/redirect/200', array('absolute' => TRUE)), TRUE, $code);
     exit;
   }
   return '';
 }
 
 function system_test_set_header() {
   drupal_add_http_header($_GET['name'], $_GET['value']);
   return t('The following header was set: %name: %value', array('%name' => $_GET['name'], '%value' => $_GET['value']));
 }
