mirror of
https://github.com/astral-sh/uv.git
synced 2025-12-08 02:47:16 +00:00
Include version and contact information in GitHub User Agent (#10785)
## Summary See: https://github.com/astral-sh/uv/pull/10765#discussion_r1922016112
This commit is contained in:
parent
5ee4cf6ff5
commit
25982929c2
4 changed files with 13 additions and 4 deletions
|
|
@ -16,6 +16,7 @@ use url::Url;
|
|||
|
||||
use uv_fs::Simplified;
|
||||
use uv_static::EnvVars;
|
||||
use uv_version::version;
|
||||
|
||||
use crate::sha::GitOid;
|
||||
use crate::{GitHubRepository, GitSha};
|
||||
|
|
@ -782,7 +783,10 @@ fn github_fast_path(
|
|||
debug!("Attempting GitHub fast path for: {url}");
|
||||
let mut request = client.get(&url);
|
||||
request = request.header("Accept", "application/vnd.github.3.sha");
|
||||
request = request.header("User-Agent", "uv");
|
||||
request = request.header(
|
||||
"User-Agent",
|
||||
format!("uv/{} (+https://github.com/astral-sh/uv)", version()),
|
||||
);
|
||||
if let Some(local_object) = local_object {
|
||||
request = request.header("If-None-Match", local_object.to_string());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue