Comparing version 2.1.3 to 2.1.4
## Changelog | ||
2.1.4: | ||
* Don't mutate passed in payload object | ||
* Change APNs development endpoint to api.development.push.apple.com | ||
* Update node-http2 fork | ||
2.1.3: | ||
@@ -4,0 +9,0 @@ * Add thread-id to notification payload (#484) |
@@ -7,3 +7,3 @@ "use strict"; | ||
production: "api.push.apple.com", | ||
sandbox: "api.sandbox.push.apple.com" | ||
development: "api.development.push.apple.com" | ||
}; | ||
@@ -98,3 +98,3 @@ | ||
else { | ||
options.address = EndpointAddress.sandbox; | ||
options.address = EndpointAddress.development; | ||
} | ||
@@ -101,0 +101,0 @@ } |
@@ -102,7 +102,5 @@ "use strict"; | ||
this.payload.aps = this.apsPayload(); | ||
return this.payload; | ||
return Object.assign({}, this.payload, {aps: this.apsPayload()}); | ||
}; | ||
module.exports = Notification; |
{ | ||
"name": "apn", | ||
"description": "An interface to the Apple Push Notification service for Node.js", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"author": "Andrew Naylor <argon@mkbot.net>", | ||
@@ -32,3 +32,3 @@ "contributors": [ | ||
"debug": "^2.6.0", | ||
"http2": "https://github.com/node-apn/node-http2/archive/apn-2.1.2.tar.gz", | ||
"http2": "https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar.gz", | ||
"node-forge": "^0.6.48", | ||
@@ -35,0 +35,0 @@ "jsonwebtoken": "^7.2.1", |
@@ -28,3 +28,3 @@ "use strict"; | ||
production: false, | ||
address: "api.sandbox.push.apple.com", | ||
address: "api.development.push.apple.com", | ||
port: 443, | ||
@@ -53,3 +53,3 @@ rejectUnauthorized: true, | ||
it("should use api.sandbox.push.apple.com as the default connection address", function () { | ||
expect(config()).to.have.property("address", "api.sandbox.push.apple.com"); | ||
expect(config()).to.have.property("address", "api.development.push.apple.com"); | ||
}); | ||
@@ -64,3 +64,3 @@ | ||
process.env.NODE_ENV = "production"; | ||
expect(config({ production: false })).to.have.property("address", "api.sandbox.push.apple.com"); | ||
expect(config({ production: false })).to.have.property("address", "api.development.push.apple.com"); | ||
}); | ||
@@ -67,0 +67,0 @@ |
@@ -80,2 +80,13 @@ "use strict"; | ||
describe("when aps properties are given by setters", function() { | ||
it("should not mutate the originally given paylaod object", function() { | ||
let payload = {"foo": "bar", "baz": 1}; | ||
note.payload = payload; | ||
note.badge = 1; | ||
note.sound = "ping.aiff"; | ||
note.toJSON(); | ||
expect(payload).to.deep.equal({"foo": "bar", "baz": 1}); | ||
}); | ||
}); | ||
describe("when aps payload is present", function() { | ||
@@ -82,0 +93,0 @@ beforeEach(function() { |
Sorry, the diff of this file is not supported yet
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
339999
4999