Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Round date epoch, causes issues sometimes else
Browse files Browse the repository at this point in the history
  • Loading branch information
matthijs2704 committed Oct 8, 2016
1 parent de8321d commit 6fec499
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/VaporAPNS/VaporAPNS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ open class VaporAPNS {
let headers = self.requestHeaders(for: message)
var curlHeaders: UnsafeMutablePointer<curl_slist>?
if !options.usesCertificateAuthentication {
let currentTime = Date().timeIntervalSince1970
let currentTime = Int(Date().timeIntervalSince1970.rounded())
let jsonPayload = try! JSON(node: [
"iss": options.teamId,
"iat": currentTime
Expand Down
2 changes: 1 addition & 1 deletion Tests/VaporAPNSTests/VaporAPNSTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class VaporAPNSTests: XCTestCase { // TODO: Set this up so others can test this
}

func testEncoding() throws {
let currentTime = Date().timeIntervalSince1970
let currentTime = Int(Date().timeIntervalSince1970.rounded())
let jsonPayload = try JSON(node: [
"iss": "D86BEC0E8B",
"iat": currentTime
Expand Down

0 comments on commit 6fec499

Please sign in to comment.