Skip to content

Commit

Permalink
Stupid Matt stupidly commited a stupid manual merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Gaunt committed Oct 14, 2016
1 parent 19a53a4 commit 1771475
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/web-push-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,14 @@ WebPushLib.prototype.generateRequestDetails =
'required encryption keys'));
}

try {
const encrypted = encryptionHelper.encrypt(
subscription.keys.p256dh, subscription.keys.auth, payload);

requestOptions.headers['Content-Length'] = encrypted.cipherText.length;
requestOptions.headers['Content-Type'] = 'application/octet-stream';
requestOptions.headers['Content-Encoding'] = 'aesgcm';
requestOptions.headers.Encryption = 'salt=' + encrypted.salt;
requestOptions.headers['Crypto-Key'] = 'dh=' + urlBase64.encode(encrypted.localPublicKey);
requestDetails.headers['Content-Length'] = encrypted.cipherText.length;
requestDetails.headers['Content-Type'] = 'application/octet-stream';
requestDetails.headers['Content-Encoding'] = 'aesgcm';
requestDetails.headers.Encryption = 'salt=' + encrypted.salt;
requestDetails.headers['Crypto-Key'] = 'dh=' + urlBase64.encode(encrypted.localPublicKey);

requestPayload = encrypted.cipherText;
} else {
Expand Down

0 comments on commit 1771475

Please sign in to comment.