From 4d0bb65dcdbf3decadfa1975c74b7c55a5237c14 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 24 Jan 2019 14:31:28 +0100 Subject: [PATCH] Issue #3018637 by emilymoi, das-peter: [regression] Unset the 'host' header in drupal_http_request() during redirect --- includes/common.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/common.inc b/includes/common.inc index c5b4ff26e261..44ff46078759 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1094,6 +1094,11 @@ function drupal_http_request($url, array $options = array()) { elseif ($options['max_redirects']) { // Redirect to the new location. $options['max_redirects']--; + + // We need to unset the 'Host' header + // as we are redirecting to a new location. + unset($options['headers']['Host']); + $result = drupal_http_request($location, $options); $result->redirect_code = $code; }