feat(core): Add config option for the url preview user agent

This commit is contained in:
Trash Panda authored and Jade Ellis committed 2026-02-15 15:21:05 +00:00
1 parent 9cae531f90
commit 40996a6602
3 files changed
+19

No files matched your search

+6
View File
@@ -36,6 +36,11 @@ impl crate::Service for Service {
.clone()
.and_then(Either::right);
let url_preview_user_agent = config
.url_preview_user_agent
.clone()
.unwrap_or_else(|| conduwuit::version::user_agent().to_string());
Ok(Arc::new(Self {
default: base(config)?
.dns_resolver(resolver.resolver.clone())
@@ -49,6 +54,7 @@ impl crate::Service for Service {
.dns_resolver(resolver.resolver.clone())
.timeout(Duration::from_secs(config.url_preview_timeout))
.redirect(redirect::Policy::limited(3))
.user_agent(url_preview_user_agent)
.build()?,
extern_media: base(config)?