Skip to content

Commit 1771475

Browse files
author
Matt Gaunt
committed
Stupid Matt stupidly commited a stupid manual merge
1 parent 19a53a4 commit 1771475

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/web-push-lib.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,14 @@ WebPushLib.prototype.generateRequestDetails =
158158
'required encryption keys'));
159159
}
160160

161-
try {
162161
const encrypted = encryptionHelper.encrypt(
163162
subscription.keys.p256dh, subscription.keys.auth, payload);
164163

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

171170
requestPayload = encrypted.cipherText;
172171
} else {

0 commit comments

Comments
 (0)