Package: apt
Version: 0.5.28.6

Some web proxies are set up to allow access to clients based on the User-Agent string value. The compiled-in apt User-Agent string is usually blocked in these environments. When this happens and no alternative network pathway is open, users are reduced to sneakernet for updates.

The patch below adds a new configuration option, Acquire::http::User- Agent, that takes a string value to be used as the User-Agent string in the http request. The existing apt User-Agent string is retained as the default.

Patch follows:

--- methods/http.cc.orig
+++ methods/http.cc
@@ -681,8 +681,12 @@
if (Uri.User.empty() == false || Uri.Password.empty() == false)
Req += string("Authorization: Basic ") + Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n";
-
- Req += "User-Agent: Debian APT-HTTP/1.3\r\n\r\n";
+
+ string UserAgent = _config->Find("Acquire::http::User-Agent");
+ if (UserAgent.empty() == false)
+       Req += "User-Agent: " + UserAgent + "\r\n\r\n";
+ else
+       Req += "User-Agent: Debian APT-HTTP/1.3\r\n\r\n";

if (Debug == true)
cerr << Req << endl;


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to