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:
npub1tquskdu6yc4h8l7xxtceculxw600grekeq0xg2ukqfrwl7vrzg3quz3gmp
2026-07-28 16:31:20 -07:00
parent 90e058ebf6
commit eb02109d07
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -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 }
+3
View File
@@ -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)?;