diff --git a/core/modules/update/tests/modules/update_test/update_test.module b/core/modules/update/tests/modules/update_test/update_test.module index ff5aad5c2f59..b40f2740f984 100644 --- a/core/modules/update/tests/modules/update_test/update_test.module +++ b/core/modules/update/tests/modules/update_test/update_test.module @@ -1,5 +1,8 @@ 'text/xml; charset=utf-8')); + } + return new StreamedResponse(function() use ($file) { + // Transfer file in 1024 byte chunks to save memory usage. + if ($fd = fopen($file, 'rb')) { + while (!feof($fd)) { + print fread($fd, 1024); + } + fclose($fd); + } + }, 200, array('Content-Type' => 'text/xml; charset=utf-8')); } /** diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc index 1b4e6ca2908d..0c331149d971 100644 --- a/core/modules/update/update.fetch.inc +++ b/core/modules/update/update.fetch.inc @@ -142,7 +142,7 @@ function _update_process_fetch_task($project) { $project_name = $project['name']; if (empty($fail[$fetch_url_base]) || $fail[$fetch_url_base] < $max_fetch_attempts) { - $xml = drupal_http_request($url); + $xml = drupal_http_request($url, array('headers' => array('accept' => 'text/xml'))); if (!isset($xml->error) && isset($xml->data)) { $data = $xml->data; }