[Bug 34009] Re: apt fails when a web proxy filters clients based on User-Agent strings

Bug Watch Updater 34009 at bugs.launchpad.net
Thu Aug 11 07:41:46 UTC 2011


** Changed in: apt (Debian)
       Status: Unknown => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/34009

Title:
  apt fails when a web proxy filters clients based on User-Agent strings

Status in “apt” package in Ubuntu:
  Fix Released
Status in “apt” package in Debian:
  Fix Released

Bug description:
  Some web proxies restrict access to clients based on the User-Agent
  HTTP request value.  When behind these proxies, the apt http method
  fails.  If no other network pathway is open, users are reduced to
  sneakernet for update transfer.

  This is an upstream bug.

  A simple patch enables a new configuration option, Acquire:http:User-
  Agent, which takes a User-Agent string value to be added to the
  request.  The existing APT-HTTP User-Agent string remains the default.

  Patch follows:

  --- methods/http.cc
  +++ 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 manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/34009/+subscriptions




More information about the foundations-bugs mailing list