-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work with wns2-pn1p.notify.windows.com
(Windows Notification Service)
#5
Comments
if we use {
"Encryption": "keyid=p256dh; salt=h9jh4Xejoawr9rf33pg6JA",
"Crypto-Key": "keyid=p256dh; dh=BGBn_RCTXZCFAm9wp_FC9VXC64-CL3rOBGM3KNL5c-OU8Cq7tuX3UXgcdvy3y5nhg41C9yL4XpIKnRptit4Lqvg; p256ecdsa=BGSDfhpjPGYGwhDoUapYitSda3wkYKVW2DF8Vnp39kcq_IOLPOvJXa1T2VbMvS3Jg40U6WQL85ZAq-yZBTjpdIc"
} we get a different error: Www-Authenticate: bearer error="invalid_request",error_description="Malformed Crypto-Key Value" The request works just fine in all other browsers except Edge ( |
@alastaircoote – any ideas on this one? |
@alastaircoote – any updates on this issue? |
Sorry, I haven't had any time, nor do I have a Windows machine to test this with. Hopefully eventually I will be able to but I'm not sure when. |
@alastaircoote – this is analyzed and fixed in https://github.com/block65/webcrypto-web-push/pull/14/files#diff-9e3275d98ef58142ceebe2df4cf3da914a2e0d7e10c09ceab5a29180cb471d21 Minimal fix for const { endpoint, headers, body } = await generatePushHTTPRequest({ applicationServerKeys, payload, target, adminContact, ttl, urgency }); if (0) console.warn('push', 0, { endpoint, headers });
headers['Crypto-Key'] = filter(headers['Crypto-Key']); // this fixes your library function filter(str, include, ...keys) {
const pairs = str.split(';').map(pair => pair.trim());
const filteredPairs = pairs.filter(pair => { const key = pair.split('=')[0]; return include ? keys.includes(key) : !keys.includes(key); });
return filteredPairs.join(';'); // ❌ '; ' vs ✔️ ';'
} It looks like |
@alastaircoote – see the Edge fix here: https://github.com/alastaircoote/webpush-webcrypto/pull/6/files |
o_O!? |
Error
Request
See the exact
subscription
,endpoint
, andheaders
👇🏻The text was updated successfully, but these errors were encountered: