We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a581a5 commit b53e60cCopy full SHA for b53e60c
js/vapid.js
@@ -186,7 +186,7 @@ class VapidToken {
186
return this.export_public_raw()
187
.then( pubKey => {
188
return {
189
- authorization: "Bearer " + content + "." + sig,
+ authorization: "WebPush " + content + "." + sig,
190
"crypto-key": "p256ecdsa=" + pubKey,
191
publicKey: pubKey,
192
}
@@ -207,7 +207,8 @@ class VapidToken {
207
*/
208
209
// Ideally, just the bearer token, Cheat a little to be nice to the dev.
210
- if (token.toLowerCase().split(" ")[0] == "bearer") {
+ scheme = token.toLowerCase().split(" ")[0]
211
+ if (scheme == "bearer" || scheme == "webpush") {
212
token = token.split(" ")[1];
213
214
0 commit comments