Skip to content

Commit

Permalink
Auto merge of #3485 - sfackler:useragent, r=alexcrichton
Browse files Browse the repository at this point in the history
Set a user agent with the version when talking to the registry

This can be used to track what versions of Cargo are being used in the
wild, which can be very useful.

r? @alexcrichton
  • Loading branch information
bors committed Jan 2, 2017
2 parents c95b873 + ae2b598 commit 71e996e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use term::color::BLACK;

use url::percent_encoding::{percent_encode, QUERY_ENCODE_SET};

use version;
use core::source::Source;
use core::{Package, SourceId, Workspace};
use core::dependency::Kind;
Expand Down Expand Up @@ -196,6 +197,7 @@ pub fn http_handle(config: &Config) -> CargoResult<Easy> {
handle.connect_timeout(Duration::new(30, 0))?;
handle.low_speed_limit(10 /* bytes per second */)?;
handle.low_speed_time(Duration::new(30, 0))?;
handle.useragent(&version())?;
if let Some(proxy) = http_proxy(config)? {
handle.proxy(&proxy)?;
}
Expand Down

0 comments on commit 71e996e

Please sign in to comment.