Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
if let Some(check) = http.check_revoke {
handle.ssl_options(SslOpt::new().no_revoke(!check))?;
}

if let Some(user_agent) = &http.user_agent {
handle.useragent(user_agent)?;
} else {
Expand Down Expand Up @@ -598,7 +599,8 @@ pub fn registry_login(
.read_line(&mut line)
.chain_err(|| "failed to read stdin")
.map_err(failure::Error::from)?;
line.trim().to_string()
// Automatically remove `cargo login` from an inputted token to allow direct pastes from `registry.host()`/me.
line.replace("cargo login", "").trim().to_string()
}
};

Expand Down