diff --git a/DIFFERENCES.md b/DIFFERENCES.md index c28fb295..f9b05c7b 100644 --- a/DIFFERENCES.md +++ b/DIFFERENCES.md @@ -37,4 +37,5 @@ - Add debug admin command to force update user device lists (could potentially resolve some E2EE flukes) (`ForceDeviceListUpdates`) - Declare various missing Matrix versions and features at `/_matrix/client/versions` - Add support for serving server and client well-known files from conduwuit using `well_known_client` and `well_known_server` options -- Add non-standard sliding sync proxy health check (?) endpoint at `/client/server.json` that some clients such as Element Web query using the `well_known_client` or `well_known_server` config options \ No newline at end of file +- Add non-standard sliding sync proxy health check (?) endpoint at `/client/server.json` that some clients such as Element Web query using the `well_known_client` or `well_known_server` config options +- Send a User-Agent on all of our requests (`conduwuit/0.7.0-alpha+conduwuit-0.1.1`) which strangely was not done upstream since forever. Some providers consider no User-Agent suspicious and block said requests. diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index bf8b3dfb..89e85fd4 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -542,7 +542,12 @@ fn reqwest_client_builder(config: &Config) -> Result { let mut reqwest_client_builder = reqwest::Client::builder() .pool_max_idle_per_host(0) .connect_timeout(Duration::from_secs(60)) - .timeout(Duration::from_secs(60 * 5)); + .timeout(Duration::from_secs(60 * 5)) + .user_agent(concat!( + env!("CARGO_PKG_NAME"), + "/", + env!("CARGO_PKG_VERSION") + )); if let Some(proxy) = config.proxy.to_proxy()? { reqwest_client_builder = reqwest_client_builder.proxy(proxy);