diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 5ea2040..0c80fae 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -211,7 +211,7 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface { public static function createFromRequest(Request $request, $class_loader, $environment, $allow_dumping = TRUE) { $kernel = new static($environment, $class_loader, $allow_dumping); static::bootEnvironment(); - $this->initializeSettings($request); + $kernel->initializeSettings($request); return $kernel; } @@ -599,6 +599,9 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = $response = new Response($message, 500); } + // Adapt response headers to the current request. + $response->prepare($request); + return $response; } diff --git a/core/lib/Drupal/Core/Test/TestRunnerKernel.php b/core/lib/Drupal/Core/Test/TestRunnerKernel.php index 0b2f790..684a83b 100644 --- a/core/lib/Drupal/Core/Test/TestRunnerKernel.php +++ b/core/lib/Drupal/Core/Test/TestRunnerKernel.php @@ -37,6 +37,8 @@ public function __construct($environment, $class_loader) { // \Drupal\Core\Datetime\DateFormatter has a (needless) dependency on the // 'date_format' entity, so calls to format_date()/format_interval() cause // a plugin not found exception. + $core_root = dirname(dirname(dirname(dirname(__DIR__)))); + require_once $core_root . '/includes/bootstrap.inc'; $this->moduleList = array( 'system' => 0, 'simpletest' => 0, diff --git a/core/modules/system/tests/http.php b/core/modules/system/tests/http.php index dff8a9e..5cdf74a 100644 --- a/core/modules/system/tests/http.php +++ b/core/modules/system/tests/http.php @@ -27,7 +27,6 @@ $request = Request::createFromGlobals(); $response = $kernel->handle($request); -$response->prepare($request); $response->send(); $kernel->terminate($request, $response); diff --git a/core/modules/system/tests/https.php b/core/modules/system/tests/https.php index 7d32639..fb5cda8 100644 --- a/core/modules/system/tests/https.php +++ b/core/modules/system/tests/https.php @@ -29,7 +29,6 @@ $request = Request::createFromGlobals(); $response = $kernel->handle($request); -$response->prepare($request); $response->send(); $kernel->terminate($request, $response); diff --git a/index.php b/index.php index 90b99b3..8d88b1c 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,6 @@ $request = Request::createFromGlobals(); $response = $kernel->handle($request); -$response->prepare($request); $response->send(); $kernel->terminate($request, $response);