Skip to content

Commit c938198

Browse files
Added a failing test when an otherwise valid key ID is encoded using Base64 instead of URL-encoded Base64, and keys would therefor not match during lookups
1 parent aa06736 commit c938198

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Tests/WebPushTests/VAPIDKeyTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import WebPushTesting
101101

102102
@Test func decoding() throws {
103103
#expect(try JSONDecoder().decode(VAPID.Key.ID.self, from: Data("\"BLf3RZAljlexEovBgfZgFTjcEVUKBDr3lIH8quJioMdX4FweRdId_P72h613ptxtU-qSAyW3Tbt_3WgwGhOUxrs\"".utf8)) == .mockedKeyID1)
104+
#expect(try JSONDecoder().decode(VAPID.Key.ID.self, from: Data("\"BLf3RZAljlexEovBgfZgFTjcEVUKBDr3lIH8quJioMdX4FweRdId/P72h613ptxtU+qSAyW3Tbt/3WgwGhOUxrs=\"".utf8)) == .mockedKeyID1)
104105
}
105106
}
106107
}

0 commit comments

Comments
 (0)