mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 12:46:49 +00:00
feat(push): Add MSC4174 web push
This commit is contained in:
1 parent
dbcffe8af0
commit
ed1e634579
23 files changed
+1864
-281
No files matched your search
@@ -24,6 +24,7 @@ pub struct Service {
|
||||
pub sender: reqwest::Client,
|
||||
pub appservice: reqwest::Client,
|
||||
pub pusher: reqwest::Client,
|
||||
pub webpush: reqwest::Client,
|
||||
|
||||
pub cidr_range_denylist: Vec<IPAddress>,
|
||||
}
|
||||
@@ -141,6 +142,16 @@ impl crate::Service for Service {
|
||||
.redirect(redirect::Policy::limited(2))
|
||||
.build()?,
|
||||
|
||||
// MSC4174 recommends against following redirects, since the destination
|
||||
// is only checked before the request is sent.
|
||||
webpush: base(config)?
|
||||
.connect_timeout(Duration::from_secs(config.pusher_conn_timeout))
|
||||
.timeout(Duration::from_secs(config.pusher_timeout))
|
||||
.pool_max_idle_per_host(1)
|
||||
.pool_idle_timeout(Duration::from_secs(config.pusher_idle_timeout))
|
||||
.redirect(redirect::Policy::none())
|
||||
.build()?,
|
||||
|
||||
cidr_range_denylist: config
|
||||
.ip_range_denylist
|
||||
.iter()
|
||||
|
||||
Reference in new issue
Block a user