Skip to content

Commit

Permalink
Add sub header to VAPID
Browse files Browse the repository at this point in the history
  • Loading branch information
p1gp1g committed Dec 24, 2024
1 parent a367740 commit 23b9d09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vapid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ fn add_vapid_header_to_cache(origin_str: &str, header: &str) {
fn gen_vapid_header_with_key(origin: url::Origin, key: &SignerWithPubKey) -> Result<String> {
let origin_str = origin.unicode_serialization();
let claims = Claims::create(jwt_simple::prelude::Duration::from_secs(DURATION_VAPID))
.with_audience(&origin_str);
.with_audience(&origin_str)
.with_subject("https://github.com/mollyim/mollysocket");
let token = key.signer.sign(claims).unwrap();

let header = format!("vapid t={},k={}", token.as_str(), &key.pubkey);
Expand Down

0 comments on commit 23b9d09

Please # to comment.