diff --git a/includes/common.inc b/includes/common.inc index 40a7919..e1b2cea 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1074,6 +1074,14 @@ function drupal_http_request($url, array $options = array()) { } elseif ($options['max_redirects']) { // Redirect to the new location. + + // If the location is a relative path, we need to add it to the existing + // scheme and host. + $location_uri = @parse_url($location); + if (empty($location_uri['schema'])) { + $location = $uri['scheme'] . '://' . $uri['host'] . $location; + } + $options['max_redirects']--; $result = drupal_http_request($location, $options); $result->redirect_code = $code;