summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-12-09 10:16:32 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-12-09 10:16:32 +0100
commit366cff695ae0a228300817e278c7ddf62ca52c34 (patch)
treef1516a044d5ae14f14bb0c19c8cadd1815407898 /methods/http.cc
parent864cf8e52aa37de28f2fc9a66236713f1ba34409 (diff)
parent777b4ac6882b40f63f1aa9b6f4da78b8fdc56cbe (diff)
merged from the mvo branch
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/methods/http.cc b/methods/http.cc
index ba0241fc1..e2057f436 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -29,6 +29,7 @@
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
+#include <apt-pkg/netrc.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -42,6 +43,7 @@
#include <map>
#include <apti18n.h>
+
// Internet stuff
#include <netdb.h>
@@ -49,7 +51,6 @@
#include "connect.h"
#include "rfc2553emu.h"
#include "http.h"
-
/*}}}*/
using namespace std;
@@ -724,10 +725,12 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
Req += string("Proxy-Authorization: Basic ") +
Base64Encode(Proxy.User + ":" + Proxy.Password) + "\r\n";
+ maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc"));
if (Uri.User.empty() == false || Uri.Password.empty() == false)
+ {
Req += string("Authorization: Basic ") +
Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n";
-
+ }
Req += "User-Agent: Ubuntu APT-HTTP/1.3 ("VERSION")\r\n\r\n";
if (Debug == true)