Skip to content

Commit 0d14f54

Browse files
committed
fix: Attempting to send body in GET/DELETE requests
1 parent 0999242 commit 0d14f54

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ module.exports = function (dependencies) {
567567
responseData += data;
568568
});
569569

570-
if (Object.keys(notification.body).length > 0) {
570+
if (notification.body !== "") {
571571
request.write(notification.body);
572572
}
573573

test/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ describe('ManageChannelsClient', () => {
17611761
const mockHeaders = { 'apns-channel-id': channel, ...additionalHeaderInfo };
17621762
const mockNotification = {
17631763
headers: mockHeaders,
1764-
body: {},
1764+
body: "",
17651765
};
17661766
const bundleId = BUNDLE_ID;
17671767
const result = await client.write(mockNotification, bundleId, 'channels', 'delete');
@@ -1822,7 +1822,7 @@ describe('ManageChannelsClient', () => {
18221822
const mockHeaders = { 'apns-request-id': requestId };
18231823
const mockNotification = {
18241824
headers: mockHeaders,
1825-
body: {},
1825+
body: "",
18261826
};
18271827
const bundleId = BUNDLE_ID;
18281828
const result = await client.write(mockNotification, bundleId, 'allChannels', 'get');

0 commit comments

Comments
 (0)