summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2007-10-11 09:47:23 (GMT)
committerGábor Hojtsy2007-10-11 09:47:23 (GMT)
commitba3c558f0de6a04810f55edd1c0b753223551ab5 (patch)
treecfa44ce9c366bae01e9b07fa89e3a8370295ee2f
parent3fb218cb7e89e28422f79fe7394f18821e1c9d2a (diff)
#182410 by greggles: HTTP Basic authentication username and password was parsed in drupal_http_request() but then not used in the request
-rw-r--r--includes/common.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 8684ff6..9dbfbe6 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;
}