mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(push): enable HTTP/2 for APNs
Co-authored-by: npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp <58390b379a262b73ffc632f19c73e6769ef40f36c81e642b960246eff9831222@buzz.block.builderlab.xyz> Signed-off-by: npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp <58390b379a262b73ffc632f19c73e6769ef40f36c81e642b960246eff9831222@buzz.block.builderlab.xyz>
This commit is contained in:
parent
90e058ebf6
commit
eb02109d07
@@ -31,7 +31,7 @@ metrics-exporter-prometheus = { workspace = true }
|
||||
nostr = { workspace = true }
|
||||
p256 = { version = "0.14", features = ["ecdsa", "pem", "pkcs8"] }
|
||||
rand = { workspace = true }
|
||||
reqwest = { workspace = true }
|
||||
reqwest = { workspace = true, features = ["http2"] }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
sqlx = { workspace = true }
|
||||
|
||||
@@ -116,6 +116,9 @@ impl ApnsTransport {
|
||||
/// Build a reusable APNs client from an Apple `.p8` private key.
|
||||
pub fn token(p8: &[u8], key_id: &str, team_id: &str, topic: String) -> Result<Self, ApnsError> {
|
||||
let client = reqwest::Client::builder()
|
||||
// APNs requires HTTP/2. This no-op method reference is intentionally
|
||||
// feature-gated so removing reqwest's `http2` feature fails the build.
|
||||
.http2_keep_alive_while_idle(false)
|
||||
.timeout(Duration::from_secs(15))
|
||||
.build()
|
||||
.map_err(|_| ApnsError::Client)?;
|
||||
|
||||
Reference in New Issue
Block a user