diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 9c2e4bad2eb1030cddc2d06548160b629de02eaf..299f9059fbf301f6446aae491538c7ebbc2586e5 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -308,6 +308,9 @@ function drupal_initialize_variables() { if (!isset($_SERVER['HTTP_REFERER'])) { $_SERVER['HTTP_REFERER'] = ''; } + if (!isset($_SERVER['SERVER_PROTOCOL']) || ($_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.0' && $_SERVER['SERVER_PROTOCOL'] != 'HTTP/1.1')) { + $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0'; + } } /** @@ -640,7 +643,7 @@ function drupal_page_cache_header($cache) { if ($if_modified_since && $if_none_match && $if_none_match == $etag // etag must match && $if_modified_since == $last_modified) { // if-modified-since must match - header('HTTP/1.1 304 Not Modified'); + header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified'); // All 304 responses must send an etag if the 200 response for the same object contained an etag header("Etag: $etag"); exit(); @@ -1020,7 +1023,7 @@ function _drupal_bootstrap($phase) { case DRUPAL_BOOTSTRAP_ACCESS: // Deny access to blocked IP addresses - t() is not yet available. if (drupal_is_denied(ip_address())) { - header('HTTP/1.1 403 Forbidden'); + header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); print 'Sorry, ' . check_plain(ip_address()) . ' has been banned.'; exit(); } diff --git a/includes/common.inc b/includes/common.inc index 13628d2f1f7d9a045c0b626d5470605a170efa48..81e2ca1cd68369d43cc65fc80407b3522f629c95 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -325,7 +325,7 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response */ function drupal_site_offline() { drupal_maintenance_theme(); - drupal_set_header('HTTP/1.1 503 Service unavailable'); + drupal_set_header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service unavailable'); drupal_set_title(t('Site offline')); print theme('maintenance_page', filter_xss_admin(variable_get('site_offline_message', t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))))); @@ -335,7 +335,7 @@ function drupal_site_offline() { * Generates a 404 error if the request can not be handled. */ function drupal_not_found() { - drupal_set_header('HTTP/1.1 404 Not Found'); + drupal_set_header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING); @@ -365,7 +365,7 @@ function drupal_not_found() { * Generates a 403 error if the request is not allowed. */ function drupal_access_denied() { - drupal_set_header('HTTP/1.1 403 Forbidden'); + drupal_set_header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING); // Keep old path for reference. diff --git a/includes/database/database.inc b/includes/database/database.inc index 2dafd3d2e607b24d95e222892610b97594be1d09..ed479fe5aa84d06aa40dc73c71824b2b4f9b1bc0 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -1780,7 +1780,7 @@ function db_change_field(&$ret, $table, $field, $field_new, $spec, $keys_new = a function _db_error_page($error = '') { global $db_type; drupal_maintenance_theme(); - drupal_set_header('HTTP/1.1 503 Service Unavailable'); + drupal_set_header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable'); drupal_set_title('Site offline'); } diff --git a/install.php b/install.php index 0ff2573bbc156e526e424e5c32f6d57593627993..35d34d8f32b09d263b06a9a32cfe27753c47760f 100644 --- a/install.php +++ b/install.php @@ -24,7 +24,7 @@ function install_main() { // running tests. However, for security reasons, it is imperative that no // installation be permitted using such a prefix. if (preg_match("/^simpletest\d+$/", $_SERVER['HTTP_USER_AGENT'])) { - header('HTTP/1.1 403 Forbidden'); + header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); exit; }