Send User-Agent header in outbound requests

This commit is contained in:
Lambda 2025-05-29 19:49:44 +00:00
parent d425ba72f8
commit c965c9747b
2 changed files with 4 additions and 1 deletions

View file

@ -324,3 +324,5 @@ This will be the first release of Grapevine since it was forked from Conduit
([!124](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/124))
26. Allow adding canonical aliases from remote servers.
([!158](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/158))
27. Grapevine now sends a User-Agent header on outbound requests
([!189](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/189))

View file

@ -653,7 +653,8 @@ fn reqwest_client_builder(config: &Config) -> Result<reqwest::ClientBuilder> {
let mut reqwest_client_builder = reqwest::Client::builder()
.pool_max_idle_per_host(0)
.connect_timeout(Duration::from_secs(30))
.timeout(Duration::from_secs(60 * 3));
.timeout(Duration::from_secs(60 * 3))
.user_agent(format!("{}/{}", env!("CARGO_PKG_NAME"), crate::version()));
if let Some(proxy) = config.proxy.to_proxy()? {
reqwest_client_builder = reqwest_client_builder.proxy(proxy);