Provide user agent when performing HTTP requests (#15470)

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2024-07-30 11:12:37 +02:00
committed by GitHub
co-authored by Nathan
parent 2a649fa824
commit fa19bc98ac
8 changed files with 40 additions and 24 deletions
+2 -1
View File
@@ -995,7 +995,8 @@ impl Server {
tracing::Span::current().record("connection_id", format!("{}", connection_id));
tracing::info!("connection opened");
let http_client = match IsahcHttpClient::new() {
let user_agent = format!("Zed Server/{}", env!("CARGO_PKG_VERSION"));
let http_client = match IsahcHttpClient::builder().default_header("User-Agent", user_agent).build() {
Ok(http_client) => Arc::new(http_client),
Err(error) => {
tracing::error!(?error, "failed to create HTTP client");