diff options
Diffstat (limited to 'methods')
-rw-r--r-- | methods/http.cc | 3 | ||||
-rw-r--r-- | methods/https.cc | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/methods/http.cc b/methods/http.cc index 461a98406..8fcff0b5d 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -728,7 +728,8 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) Req += string("Authorization: Basic ") + Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n"; - Req += "User-Agent: Debian APT-HTTP/1.3 ("VERSION")\r\n\r\n"; + Req += "User-Agent: " + _config->Find("Acquire::http::User-Agent", + "Debian APT-HTTP/1.3 ("VERSION")") + "\r\n\r\n"; if (Debug == true) cerr << Req << endl; diff --git a/methods/https.cc b/methods/https.cc index 79e6fea3f..e8d7bb5c6 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -209,7 +209,10 @@ bool HttpsMethod::Fetch(FetchItem *Itm) curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, dlLimit); // set header - curl_easy_setopt(curl, CURLOPT_USERAGENT,"Debian APT-CURL/1.0 ("VERSION")"); + curl_easy_setopt(curl, CURLOPT_USERAGENT, + _config->Find("Acquire::https::User-Agent", + _config->Find("Acquire::http::User-Agent", + "Debian APT-CURL/1.0 ("VERSION")"))); // set timeout int timeout = _config->FindI("Acquire::http::Timeout",120); |