From ba3c558f0de6a04810f55edd1c0b753223551ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 11 Oct 2007 09:47:23 +0000 Subject: #182410 by greggles: HTTP Basic authentication username and password was parsed in drupal_http_request() but then not used in the request --- includes/common.inc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 8684ff6be..9dbfbe6c5 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -458,6 +458,11 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = 'Content-Length' => 'Content-Length: '. strlen($data) ); + // If the server url has a user then attempt to use basic authentication + if (isset($uri['user'])) { + $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : '')); + } + foreach ($headers as $header => $value) { $defaults[$header] = $header .': '. $value; } -- cgit v1.2.3