Skip to content

Commit 644a073

Browse files
author
Matt Gaunt
committed
requestDetails
1 parent 6f02d24 commit 644a073

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/web-push-lib.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,14 @@ WebPushLib.prototype.sendNotification =
234234
}
235235

236236
return new Promise(function(resolve, reject) {
237-
console.log(requestDetails);
238-
239237
const httpsOptions = {};
240238
const urlParts = url.parse(requestDetails.endpoint);
241239
httpsOptions.hostname = urlParts.hostname;
242240
httpsOptions.port = urlParts.port;
243241
httpsOptions.path = urlParts.path;
244242

245243
httpsOptions.headers = requestDetails.headers;
246-
247-
console.log(httpsOptions);
244+
httpsOptions.method = requestDetails.method;
248245

249246
const pushRequest = https.request(httpsOptions, function(pushResponse) {
250247
let responseText = '';
@@ -255,6 +252,7 @@ WebPushLib.prototype.sendNotification =
255252

256253
pushResponse.on('end', function() {
257254
if (pushResponse.statusCode !== 201) {
255+
console.log(responseText);
258256
reject(new WebPushError('Received unexpected response code',
259257
pushResponse.statusCode, pushResponse.headers, responseText));
260258
} else {

0 commit comments

Comments
 (0)